An example that shows the difference between creating a JavaScript class and subclass in ES5 and ES6.
This file contains hidden or 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 | |
| # This Works is placed under the terms of the Copyright Less License, | |
| # see file COPYRIGHT.CLL. USE AT OWN RISK, ABSOLUTELY NO WARRANTY. | |
| # | |
| # COPYRIGHT.CLL can be found at http://permalink.de/tino/cll | |
| # (CLL is CC0 as long as not covered by any Copyright) | |
| OOPS() { echo "OOPS: $*" >&2; exit 23; } | |
| [ -z "`pidof openssl`" ] || OOPS "openssl running, consider: killall openssl" |
This file contains hidden or 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
| Disable vim automatic visual mode on mouse select | |
| issue: :set mouse-=a | |
| add to ~/.vimrc: set mouse-=a | |
| my ~/.vimrc for preserving global defaults and only changing one option: | |
| source $VIMRUNTIME/defaults.vim | |
| set mouse-=a |
This list is based on aliases_spec.rb.
You can see also Module: RSpec::Matchers API.
| matcher | aliased to | description |
|---|---|---|
| a_truthy_value | be_truthy | a truthy value |
| a_falsey_value | be_falsey | a falsey value |
| be_falsy | be_falsey | be falsy |
| a_falsy_value | be_falsey | a falsy value |
This file contains hidden or 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
| chmod a+w -R config/ | |
| chmod a+w -R cache/ | |
| chmod a+w -R log/ | |
| chmod a+w -R img/ | |
| chmod a+w -R mails/ | |
| chmod a+w -R modules/ | |
| chmod a+w -R themes/default-bootstrap/lang/ | |
| chmod a+w -R themes/default-bootstrap/pdf/lang/ | |
| chmod a+w -R themes/default-bootstrap/cache/ | |
| chmod a+w -R translations/ |
This file contains hidden or 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
| # activerecord-3.0.0/lib/active_record/connection_adapters/mysql_adapter.rb | |
| # Maps logical Rails types to MySQL-specific data types. | |
| def type_to_sql(type, limit = nil, precision = nil, scale = nil) | |
| return super unless type.to_s == 'integer' | |
| case limit | |
| when 1; 'tinyint' | |
| when 2; 'smallint' | |
| when 3; 'mediumint' | |
| when nil, 4, 11; 'int(11)' # compatibility with MySQL default |
This file contains hidden or 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
| # SSL self signed localhost for rails start to finish, no red warnings. | |
| # 1) Create your private key (any password will do, we remove it below) | |
| $ openssl genrsa -des3 -out server.orig.key 2048 | |
| # 2) Remove the password | |
| $ openssl rsa -in server.orig.key -out server.key |
This file contains hidden or 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 'resque/tasks' | |
| namespace :resque do | |
| def del(key) | |
| Resque.redis.keys(key).each { |k| Resque.redis.del(k) } | |
| end | |
| desc "Resque setup according to installation guide" | |
| task :setup => :environment |
This file contains hidden or 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 'stringio' | |
| require 'timeout' | |
| class Object | |
| def methods_returning(expected, *args, &blk) | |
| old_stdout = $> | |
| $> = StringIO.new | |
| methods.select do |meth| | |
| Timeout::timeout(1) { dup.public_send(meth, *args, &blk) == expected rescue false } rescue false |
This file contains hidden or 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
| note: set accordingly | |
| export PATH=$PATH:/users/daryl/dev/gis/osmosis/package/bin | |
| note: is space delimited | |
| export JAVACMD_OPTIONS="-Xmx5G -Djava.io.tmpdir=/Volumes/1TBHD0/tmp" | |
| osmosis \ | |
| --read-pbf planet-latest.osm.pbf \ | |
| --tf accept-nodes "boundary=administrative" \ | |
| --tf reject-relations \ |