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
# each | |
h = [10, 20, 30] | |
hh = h.each {|e| e*2 } # does not create new object | |
# print h | |
# print h.object_id == hh.object_id # true | |
# map | |
x = [1, 2, 3] | |
z = x.map { |e| e*2 } # does create new object - non-destructive manner | |
# print x |
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
/* | |
Dartium => Build of Chromium that has Dart VMtree-shaking process where unused code is not included in the final output of the program, that said u can import all kind libraries and not caring about unuse code.eg dart2js supports tree-shaking for Dart and Js outputs | |
final variables can not change | |
static class level fields | |
string interpolation: '$_firstName $_secondName' | |
=> expr; shorthand for {return expr;} | |
*/ | |
PirateName.readyThePirates() |
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
Procfile | |
web: ./dart-sdk/bin/dart bin/basic_http_server.dart | |
heroku create myfirstdartappforheroku -s cedar | |
heroku labs:enable user-env-compile | |
heroku config:set DART_SDK_URL=https://github.com/selkhateeb/heroku-vagrant-dart-build/releases/download/latest/dart-sdk.tar | |
heroku config:add BUILDPACK_URL=https://github.com/igrigorik/heroku-buildpack-dart.git | |
git push heroku master | |
heroku ps:scale web=1 |
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
# describe table | |
SELECT attname, attnotnull FROM pg_attribute,pg_class WHERE attrelid=pg_class.oid AND relname='uploads' AND attstattarget <>0; | |
# start process | |
postgres -D /usr/local/var/postgres | |
# list roles | |
\du | |
# list tables |
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
# blocks | |
# most basic closure | |
# can not be saved | |
# wrong_proc = { puts 'hi' } | |
correct_proc = Proc.new { puts 'procedure' } | |
3.times { puts 'block' } # works | |
# 3.times proc # wont work | |
3.times(&correct_proc) |
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
# sleep | |
protractor.getInstance().sleep(2 * 1000); | |
browser.pause(); | |
// java -Dwebdriver.chrome.driver=/Users/chris/projects/xims-platform/xims-app/node_modules/protractor/selenium/chromedriver -jar /Users/chris/projects/xims-platform/xims-app/node_modules/protractor/selenium/selenium-server-standalone-2.39.0.jar | |
// | |
// | |
// |
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
// mock service, override methods | |
EmployeeService = $injector.get('EmployeeService'); | |
spyOn(EmployeeService, 'getAllUrl') | |
.andReturn('http://0.0.0.0:3000/1/employees'); | |
// mock service, replace | |
mockEmployeeService = { | |
getAll: function() { | |
return employees; | |
} |
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 drone | |
puts 'start controlling drone' | |
yield | |
end | |
def fly | |
puts 'flying' | |
yield if block_given? | |
end | |
def move direction | |
puts "moving #{direction.to_s}" |
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
https://github.com/mhoofman/wordpress-heroku | |
https://api.wordpress.org/secret-key/1.1/salt/ |
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
# htdocs on mac | |
# defined within | |
/etc/apache2/httpd.conf | |
<IfDefine WEBSHARING_ON> | |
# | |
# DocumentRoot: The directory out of which you will serve your | |
# documents. By default, all requests are taken from this directory, but | |
# symbolic links and aliases may be used to point to other locations. |
OlderNewer