Tags » Code Snippets

#NoobTips Pseudo Update method using Coroutines

You know what an Update method does. It loops indefinitely after the Start method is called. But sometimes we want some code to loop for a fixed amount of time. 140 more words

C#

Shell script to setup local dev environment

I’m working on this one project that is getting larger and larger, and with each new feature, I’m finding that there are lots of things I need to run locally for my local setup to work:¬†Django, Celery, Solr, and a shell. 208 more words

Bash Scripting

Looping through a multiselect

<select multiple="multiple" id="myMultiSelect" name="myMultiSelect">
    <option value="1">Cats</option>
    <option value="2">Dogs</option>
    <option value="3">Birds</option>
    <option value="4">Other</option>
</select>
<input type="text" id="more_info" style="display: none;"/>
$("#myMultiSelect").on('change', function() {
        var other_is_selected = $(this).find('option').is(':selected');

        if (other_is_selected) {
            $("#more_info").show();
        } else {
            $("#more_info").hide();
        }
    });
Code Snippets

Writing code snippets in wordpress without plugins

The other day I was trying to put some code snippets in a blog entry. At some point, without exactly understand how, I started a two days fight with the WordPress editor. 466 more words

Code Snippets

Inserting code snippets in the AX 2012 X++ editor

In the AX 2012 X++ you can quickly insert fragments of code to avoid tedious typing, such as typing for a loop.

To insert a snippet, you must enter the snippets alias (which is usually the first symbol of the code), and press tab. 235 more words

X++ Snippets

Dismiss iOS On Screen Keyboard after editing TextField - Code Snippet

By clicking outside the TextField

override func touchesBegan(touches: NSSet, withEvent event: UIEvent){
self.view.endEditing(true)
}

In IBAction of some view

@IBOutlet weak var mytextfield: UITextField!
@IBAction func doSomething(sender: AnyObject) {
mytextfield.resignFirstResponder()
... 85 more words
Code Snippets

PowerShell: The basic template in ISE

The basic Ctrl-J template in the PowerShell ISE is a bit noisier than I need. This is all I want:

<#
.Synopsis
Drop set of databases… 21 more words

Powershell