This is a .docx document.
Bold Text
| #!/bin/bash | |
| ############################################### | |
| # To use: | |
| # chmod +x install-redis.sh | |
| # ./install-redis.sh | |
| ############################################### | |
| version=stable | |
| port=6379 |
| # source https://stackoverflow.com/a/38605526 | |
| JS_PATH = "app/assets/javascripts/**/*.js"; | |
| Dir[JS_PATH].each do |file_name| | |
| puts "\n#{file_name}" | |
| puts Uglifier.compile(File.read(file_name)) | |
| end |
| // sample code in the Swift class I'm teaching, on making network request to Instagram to get photos | |
| var clientId = "Put your client id here" | |
| // if you like to use Swift's Dictionary data type, you can use: `let photos = [Dictionary<String, AnyObject>]()` | |
| let photos = [NSDictionary]() | |
| var url = NSURL(string: "https://api.instagram.com/v1/media/popular?client_id=\(clientId)")! | |
| let session = NSURLSession.sharedSession() | |
| let task = session.dataTaskWithURL(url) { (data: NSData?, response: NSURLResponse?, error: NSError?) -> Void in | |
| guard error == nil else { |
| # file: config/deploy/vagrant.rb | |
| # this allows for `cap vagrant deploy` | |
| set :rails_env, :production | |
| set :server_hostname, "192.168.33.10" | |
| server 'vagrant', user: 'vagrant', roles: %w{app web db}, primary: true | |
| set :ssh_options, { | |
| forward_agent: true, | |
| host_name: "127.0.0.1", | |
| port: "2222", | |
| keys: ['.vagrant/machines/default/virtualbox/private_key'] |
| git branch -r --merged | grep -vw "master" | grep -vw "HEAD" | grep -vw "develop" | cut -d "/" -f2 -f3| xargs -p -I {} git push origin :{} |
| # source: http://stackoverflow.com/questions/9067559/sorting-ip-addresses-in-vim | |
| :%s/\<\d\d\?\>/0&/g|%&&|sor r/\(\d\{3}\)\%(\.\d\{3}\)\{3}/|%s/\<00\?\ze\d//g |
| .0.0-p247 :074 > class Q | |
| 2.0.0-p247 :075?> def test | |
| 2.0.0-p247 :076?> puts "no block. but you can pass a block to me" | |
| 2.0.0-p247 :077?> end | |
| 2.0.0-p247 :078?> def btest(&block) | |
| 2.0.0-p247 :079?> puts "with block" | |
| 2.0.0-p247 :080?> block.call | |
| 2.0.0-p247 :081?> end | |
| 2.0.0-p247 :082?> def ctest | |
| 2.0.0-p247 :083?> if block_given? |
| " Shortcuts for backbone.js via the asset pipeline | |
| " using backbone-on-rails gem and generate with backbone namespace | |
| autocmd User Rails Rnavcommand bmodel app/assets/javascripts/backbone/models -suffix=.js.coffee -glob=* | |
| autocmd User Rails Rnavcommand bcollection app/assets/javascripts/backbone/collection -suffix=.js.coffee -glob=* | |
| autocmd User Rails Rnavcommand brouter app/assets/javascripts/backbone/routers -suffix=.js.coffee -glob=* | |
| autocmd User Rails Rnavcommand btemplate app/assets/backbone/templates -suffix=.jst.hbs -glob=**/* | |
| autocmd User Rails Rnavcommand bview app/assets/javascripts/backbone/views -suffix=.js.coffee -glob=**/* |