###Icons
Name | Size |
---|---|
iphone_2x | 120x120 |
iphone_3x | 180x180 |
ipad | 76x76 |
ipad_2x | 152x152 |
android_ldpi | 36x36 |
android_mdpi | 48x48 |
# frozen_string_literal: true | |
# config/initializers/colorized_logger.rb | |
# This initializer adds color to the Rails logger output. It's a nice way to | |
# visually distinguish log levels. | |
module ColorizedLogger | |
COLOR_CODES = { | |
debug: "\e[36m", # Cyan | |
info: "\e[32m", # Green | |
warn: "\e[33m", # Yellow |
// 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'; |
class DummyController < ApplicationController | |
def do | |
render json: { balance: 50 } | |
end | |
end |
module.exports = function(config) { | |
config.set({ | |
basePath: '../../', | |
frameworks: ['jasmine', 'jquery-2.1.0'], | |
plugins: [ | |
'karma-babel-preprocessor', | |
'karma-jquery', | |
'karma-jasmine', | |
'karma-mocha-reporter', | |
], |
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) {
Douglas Crockford, author of JavaScript: The Good parts, recently gave a talk called The Better Parts, where he demonstrates how he creates objects in JavaScript nowadays. He doesn't call his approach anything, but I will refer to it as Crockford Classless.
Crockford Classless is completely free of class, new, this, prototype and even Crockfords own invention Object.create.
I think it's really, really sleek, and this is what it looks like:
function dog(spec) {
if _, err := os.Stat("/path/to/whatever"); os.IsNotExist(err) { | |
// path/to/whatever does not exist | |
} | |
if _, err := os.Stat("/path/to/whatever"); !os.IsNotExist(err) { | |
// path/to/whatever exists | |
} |
I’ll assume you are on Linux or Mac OSX. For Windows, replace ~/.vim/
with $HOME\vimfiles\
and forward slashes with backward slashes.
Vim plugins can be single scripts or collections of specialized scripts that you are supposed to put in “standard” locations under your ~/.vim/
directory. Syntax scripts go into ~/.vim/syntax/
, plugin scripts go into ~/.vim/plugin
, documentation goes into ~/.vim/doc/
and so on. That design can lead to a messy config where it quickly becomes hard to manage your plugins.
This is not the place to explain the technicalities behind Pathogen but the basic concept is quite straightforward: each plugin lives in its own directory under ~/.vim/bundle/
, where each directory simulates the standard structure of your ~/.vim/
directory.