🏳️🌈
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
map "<Cmd-Ctrl-p>" { Spotify.play_pause } | |
map "<Cmd-Ctrl-j>" { Spotify.next } | |
map "<Cmd-Ctrl-k>" { Spotify.previous } | |
map "<Cmd-Shift-m>" { activate("MacVim") } | |
map "<Cmd-Shift-b>" { activate("Google Chrome") } | |
only /iTerm/ do | |
map '<Cmd-w>', nil | |
map '<Cmd-q>', nil |
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
1) you don't need the var keyword. all variables will be protected from the global scope. | |
2) functions automatically return the last line, called an "explicit return" | |
3) functions are the funkiest looking but really simple. they look like this: | |
(obj) -> "this is my #{obj}" | |
instead of: | |
function(obj) { | |
return "this is my " + obj); |
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
#!/usr/bin/env bash | |
# repository | |
cd /tmp | |
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm | |
rpm -Uvh epel-release-6-8.noarch.rpm | |
# system update | |
yum -y update | |
yum -y groupinstall "Development Tools" | |
yum -y install libxslt-devel libyaml-devel libxml2-devel gdbm-devel libffi-devel zlib-devel openssl-devel libyaml-devel readline-devel curl-devel openssl-devel pcre-devel git memcached-devel valgrind-devel mysql-devel ImageMagick-devel ImageMagick |
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
{"items":[ | |
{"name":"left-arrow","quantity":1,"repaint":false}, | |
{"name":"right-arrow","quantity":1,"repaint":false}, | |
{"name":"combo-left-thru","quantity":1,"repaint":false}] } |
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
@MyApp.module "Concerns", (Concerns, App, Backbone, Marionette, $, _) -> | |
Concerns.CompositeTableView = | |
template: "backbone/_concerns/templates/composite_table_view" | |
itemViewContainer: "tbody" | |
ui: | |
"headerRow" : "thead tr" | |
"actions" : ".actions" | |
"description" : ".description" |
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
do (Backbone) -> | |
_sync = Backbone.sync | |
Backbone.sync = (method, entity, options = {}) -> | |
_.defaults options, | |
beforeSend: _.bind(methods.beforeSend, entity) | |
complete: _.bind(methods.complete, entity) | |
sync = _sync(method, entity, options) | |
if !entity._fetch and method is "read" |
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
# doesn't work | |
# Error: /Users/ignu/code/true-app/spec/react-tests/log-activity-test.coffee: | |
# Cannot find module './log_activity' from '/Users/ignu/code/true-app/spec/react-tests/log-activity-test.coffee' | |
r = (path)-> | |
jest.dontMock path | |
require path | |
r('./log_activity') | |
# totally works fine | |
jest.dontMock('./log_activity') |
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
private void handleException(Exception e) { | |
String[] error = e.getMessage().split("Error Code - "); | |
String errorMessage = error[0]; | |
if (error.length == 2) { // error code has been supplied | |
int errorCode = Integer.parseInt(error[1]); | |
if (errorCode == 431) { | |
// ... | |
} else if (errorMessage.contains("Can't delete snapshotshot 4 due to it is not in BackedUp Status")) { | |
throw new EC2ServiceException(ClientError.IncorrectState, "Specified snapshot is not in the correct state 'completed' for deletion"); | |
} else if (errorMessage.contains("Public key is invalid")) { |
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
#!/bin/bash | |
# Called by "git push" after it has checked the remote status, | |
# but before anything has been pushed. | |
# | |
# If this script exits with a non-zero status nothing will be pushed. | |
# | |
# Steps to install, from the root directory of your repo... | |
# 1. Copy the file into your repo at `.git/hooks/pre-push` | |
# 2. Set executable permissions, run `chmod +x .git/hooks/pre-push` |
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
cool | o | |
---|---|---|
oneaf | adsf | |
af | asdf |