###Icons
| Name | Size |
|---|---|
| iphone_2x | 120x120 |
| iphone_3x | 180x180 |
| ipad | 76x76 |
| ipad_2x | 152x152 |
| android_ldpi | 36x36 |
| android_mdpi | 48x48 |
| <% | |
| # RNB, A VIM COLORSCHEME TEMPLATE | |
| # Author: Romain Lafourcade (https://github.com/romainl) | |
| # Canonical URL: https://gist.github.com/romainl/5cd2f4ec222805f49eca | |
| # This template is designed to help vimmers create their own colorschemes | |
| # without much effort. | |
| # | |
| # You will need Ruby to generate your colorscheme but Ruby knowledge is | |
| # not needed at all. |
| // Creating Meteor HOCs | |
| import { Meteor } from 'meteor/meteor'; | |
| import { createContainer } from 'meteor/react-meteor-data'; | |
| import React from 'react'; | |
| import { compose } from 'recompose'; | |
| // Assuming we have a Meteor collection here... | |
| import TodosCollection from '../api/TodosCollection'; |
| #!/bin/bash | |
| APPNAME=<%= appName %> | |
| APP_PATH=/opt/$APPNAME | |
| BUNDLE_PATH=$APP_PATH/current | |
| ENV_FILE=$APP_PATH/config/env.list | |
| PORT=<%= port %> | |
| USE_LOCAL_MONGO=<%= useLocalMongo? "1" : "0" %> | |
| # remove previous version of the app, if exists |
| import os | |
| from progressbar import ProgressBar, Percentage, Bar, ETA | |
| print "----------------- Icon Generator ------------------" | |
| print "Usage: icon-generator.py" | |
| print "See files_ios { } in icon-generator.py" | |
| print "icon-ios.png and icon-android.png" | |
| print "---------------------------------------------------" | |
| input_ios = './icon-ios.png' |
###Icons
| Name | Size |
|---|---|
| iphone_2x | 120x120 |
| iphone_3x | 180x180 |
| ipad | 76x76 |
| ipad_2x | 152x152 |
| android_ldpi | 36x36 |
| android_mdpi | 48x48 |
Douglas Crockford showed a slide showing how he creates JavaScript objects in 2014.
He no longer uses Object.create(), avoids 'this' and doesn't even care about memory reduction by using prototypes.
https://www.youtube.com/watch?v=bo36MrBfTk4 (skip ahead to 35 mins for relevant section)
Here is the pattern described on the slide:
function constructor(spec) {
| $ rails console | |
| Loading development environment (Rails 3.0.6) | |
| ruby-1.8.7-p334 :001 > r = Rails.application.routes | |
| Gives you a handle of all the routes (config/routes.rb) | |
| #Inspect a named route: | |
| ruby-1.8.7-p334 :005 > r.recognize_path(app.destroy_user_session_path) | |
| => {:action=>"destroy", :controller=>"sessions"} |
| hash = { 'foo' => 'bar' } | |
| # Version 1 | |
| hash = Hash[hash.map { |k, v| [k.to_sym, v] }] | |
| # Version 2 | |
| hash = hash.reduce({}) do |memo, (k, v)| | |
| memo.tap { |m| m[k.to_sym] = v } | |
| end |
| # Simple 16 step drum machine experiment with Node and CoffeeScript | |
| # by Peter Cooper - @peterc | |
| # | |
| # Inspired by Giles Bowkett's screencast at | |
| # http://gilesbowkett.blogspot.com/2012/02/making-music-with-javascript-is-easy.html | |
| # | |
| # Screencast demo of this code at http://www.youtube.com/watch?v=qWKkEaKL6DQ | |
| # | |
| # Required: | |
| # node, npm and coffee-script installed |
| cd ~ | |
| sudo apt-get update | |
| sudo apt-get install openjdk-7-jre-headless -y | |
| ### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch and replace wget link below | |
| # NEW WAY / EASY WAY | |
| wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.1.1.deb | |
| sudo dpkg -i elasticsearch-1.1.1.deb |