- Pastebot
- GIF Brewery
- Slack
- Keynote/Pages/Numbers
- 1Password
- OmniFocus 3
- Airmail 3
- iA Writer
| /* | |
| Code examples from the article: S.O.L.I.D The first 5 priciples of Object Oriented Design with JavaScript | |
| https://medium.com/@cramirez92/s-o-l-i-d-the-first-5-priciples-of-object-oriented-design-with-javascript-790f6ac9b9fa#.7uj4n7rsa | |
| */ | |
| const shapeInterface = (state) => ({ | |
| type: 'shapeInterface', | |
| area: () => state.area(state) | |
| }) |
| package main | |
| import ( | |
| "os" | |
| "fmt" | |
| "bufio" | |
| "strings" | |
| "strconv" | |
| "time" | |
| "math/rand" |
gem 'browserify-rails', '1.5.0' # until fix: https://github.com/browserify-rails/browserify-rails/issues/101
gem 'react-rails'Browserify-rails allows to use browserify within assets pipeline. React-rails is here only to allow to use #react_component (and thus, prerendering).
Note that jquery-rails can be removed from Gemfile, the npm version of jquery and jquery-ujs will be used instead.
Have a good time with bash for a long while, it's time to try another tempting shell - Zsh. So, this Gist is nothing but my collection for the environment that I've searched and applied to my system. There is also this kind of Gist in a version of bash.
There are several shells out there but this is the one that is close to the bash with some useful and attractive features especially - yes, theme. Here are some good articles about how and why to choose Zsh over bash, enjoy trying!
| require 'socket' | |
| require 'openssl' | |
| require 'puma/server' | |
| require 'ds9' | |
| class Server < DS9::Server | |
| def initialize socket, app | |
| @app = app | |
| @read_streams = {} | |
| @write_streams = {} |
| var results = []; | |
| var app = { | |
| initialize: function() { | |
| var arr = [ | |
| this.generateMediaObj('imgs/avengers.jpg', "Avengers", "2012"), | |
| this.generateMediaObj('imgs/blade_runner.jpg', "Blade Runner", "1982") | |
| ]; | |
| /* eachLimit(arr, limit, iterator, callback) */ | |
| async.eachLimit(arr, 1, this.makeRequest, this.onComplete); |
| { | |
| "dependencies": { | |
| "async": "^0.9.0", | |
| "cheerio": "^0.19.0", | |
| "datauri": "^0.6.0", | |
| "unirest": "^0.4.0" | |
| } | |
| } |
For simple duplicate checking, which is faster, a Ruby hash, array, or set?
For arrays, we try two approaches, when inserting data either avoid duplicates, or just add them to the list.
This is most likely flawed, and should probably be taken with a grain of salt.
| #!/bin/sh | |
| # PATH TO YOUR HOSTS FILE | |
| ETC_HOSTS=/etc/hosts | |
| # DEFAULT IP FOR HOSTNAME | |
| IP="127.0.0.1" | |
| # Hostname to add/remove. | |
| HOSTNAME=$1 |