Skip to content

Instantly share code, notes, and snippets.

anonymous
anonymous / index.html
Created March 10, 2016 12:32
JS Bin // source http://jsbin.com/xaveragopa
<!DOCTYPE html>
<html>
<head>
<script src="https://npmcdn.com/expect/umd/expect.min.js"></script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
@johnrees
johnrees / opacity_mixin.css.scss
Created May 2, 2012 11:26
SASS/SCSS Internet Explorer Compatible Opacity Mixin
@mixin opacity($alpha) {
// IE 8
-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=$alpha*100)";
// IE 5-7
filter: alpha(opacity=$alpha*100);
// Real Browsers
-webkit-opacity: $alpha;
-moz-opacity: $alpha;
-khtml-opacity: $alpha;
opacity: $alpha;
@bahmutov
bahmutov / tmux.md
Last active March 31, 2017 15:47
tmux basics

install

Install on Mac using brew install tmux and start with tmux

main commands

See help (list of commands) with Control-b ? key combination. Leave help view by pressing q key. From now on use Control-b (aka C-b) to start all tmux commands (C-b is called command prefix and can be changed, see tmux.config options).

@getify
getify / 1.js
Last active October 15, 2017 01:35
generators as object iterator
// ugly way
var obj = {
a: 1,
b: 2,
c: 3,
[Symbol.iterator]() {
var keys = Object.keys(this);
var idx = 0;
return {
import java.util.Map;
import java.util.Comparator;
import java.util.Collections;
int index = 0;
PImage pokemon, current;
PGraphics pie;
HashMap<Integer,Integer> colorMap;
ArrayList<Integer> colorByCount;
<?xml version="1.0"?>
<root>
<item>
<name>Control/Escape</name>
<appdef>
<appname>MACVIM</appname>
<equal>org.vim.MacVim</equal>
</appdef>
<appdef>
<appname>TERMINAL</appname>
// by @noffle
autoinstall () {
local MODULES=$(cat $1 | grep "require('.*')" | sed "s/.*require('\(.*\)')/\1/" | grep -v '^\.' | tr '\n' ' ')
shift
shift
npm install $MODULES $@
}
@inopinatus
inopinatus / hstore_accessor.rb
Last active February 22, 2019 08:32
hstore accessor class method for AR
# include from an initializer
module HstoreAccessor
def self.included(base)
base.extend(ClassMethods)
end
module ClassMethods
def hstore_accessor(hstore_attribute, *keys)
Array(keys).flatten.each do |key|
@haveaguess
haveaguess / HSBC.js
Created October 8, 2016 19:52 — forked from benjie/HSBC.js
HSBC Personal Statement to CSV
/******************************
HSBC Personal Statement to CSV
v0.5
Copyright: Benjie Gillam (2012)
License: WTFPL v2.0 ( http://en.wikipedia.org/wiki/WTFPL )
Instructions:
Add the following bookmarklet to your browser:
@panuta
panuta / gist:1852087
Last active April 8, 2020 16:46
How to setup Django/Postgresql on OS X Mountain Lion using Homebrew

Command Line Tools for Xcode

Command line tools comes bundle with Xcode prior to 4.3 version. After 4.3, you need to install a separated command line tools yourself.

First, go to this url and login using Apple Developer account (Free to register)

https://developer.apple.com/downloads/index.action