This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div ng-if="false"> | |
<!-- | |
Here is a comment which will not be shown in production code. | |
--> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Set StrictHostKeyChecking no in your ~/.ssh/config file, where it will be the default for only the current user. Or you can use it on the command line: | |
ssh -o StrictHostKeyChecking=no -l $user $host |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
/** | |
* An ng-include replacement which transparently inherits the parent scope and also allows local customisation of variables | |
* within the snippet. | |
* | |
* Designed to use $templateCache (in production) and fallback to an AJAX request (for dev-mode) to load view templates. | |
* | |
* Use as below (can customise variables used in the snippet via ng-init): | |
* <div include="'users/_password_confirmation_input.html'" ng-init="placeholder = 'Re-enter Password'"></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
wget -m http://localhost:3000/api/docs | |
mv localhost\:3000/ api-documentation | |
mv ./api-documentation/api/docs ./api-documentation/api/docs.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ruby / Groovy | |
def get_types | |
words.collect{|word| word.word_type} | |
end | |
15 seconds to code. | |
3 seconds to read and understand. | |
Easy to read = self documenting. | |
Less LOC = better codebase and more agile team. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'active_support' | |
## strange this isn't done implicitly | |
class A | |
class << self | |
extend ActiveSupport::Memoizable | |
def my_class_method(x) | |
# cool stuff here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
let "RESULT=$(ps ax | grep $1 | wc -l) - 1" ;echo "$RESULT processes found for $1."; if [ "$RESULT" == 0 ]; then exit 0; else exit 1;fi; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rm -rf `find . -type d -name .svn` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def some_method(single_or_array) | |
single_or_array = [*single_or_array] | |
# do awesome stuff here... | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("#e2").select2({ | |
placeholder: "Select a State", | |
allowClear: true | |
}); |
OlderNewer