Skip to content

Instantly share code, notes, and snippets.

{
"theme": "Soda Dark.sublime-theme",
"font_face": "Inconsolata",
"font_size": 12,
"rulers": [80],
"scroll_speed": 0
}
@i11v
i11v / gist:2723241
Created May 18, 2012 04:59
Sublime Text 2 Windows config
{
"color_scheme": "Packages/User/Monokai Soda.tmTheme",
"font_face": "Consolas",
"font_size": 10,
"ignored_packages":
[
"Vintage"
],
"rulers":
[
@i11v
i11v / gist:2723258
Created May 18, 2012 05:03 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@i11v
i11v / npm-sm-installation.log
Created December 11, 2012 08:33
NPM SM installation log
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/Cellar/node/0.8.15/bin/node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'install',
1 verbose cli '-g',
1 verbose cli 'sm' ]
2 info using [email protected]
3 info using [email protected]
4 verbose read json /usr/local/share/npm/lib/package.json
5 verbose read json /usr/local/share/npm/lib/package.json
@i11v
i11v / gist:4359829
Created December 22, 2012 16:43 — forked from hzlzh/gist:3128038
<snippet>
<!-- put this file in /packages/User/<Folder Name>/console_log.sublime-snippet then restart your Sublime Text 2 -->
<content><![CDATA[console.log($1);$0]]></content>
<tabTrigger>co</tabTrigger>
<scope>text.html,source.js</scope>
<description>console.log()</description>
</snippet>
<snippet>
<!-- put this in another file /packages/User/<Folder Name>/console_dir.sublime-snippet then restart your Sublime Text 2 -->
@i11v
i11v / jquery.fn.serializeObject.js
Last active December 10, 2015 01:38
This function extends jQuery by serializeObject method. Argument — form data, returns object.
;(function ($) {
$.fn.serializeObject = function () {
var obj = {},
arr = this.serializeArray();
$.each(arr, function () {
if (typeof obj[this.name] !== "undefined") {
if (!obj[this.name].push) {
obj[this.name] = [obj[this.name]];
}
@i11v
i11v / .vimrc
Last active December 10, 2015 02:58
" --------------------------
" Basic preferences
" --------------------------
" Disable compability with vi
set nocompatible
" Set backup dirs
set dir=~/tmp
set bdir=~/.backup
# bash/zsh completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <[email protected]>
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
# Distributed under the GNU General Public License, version 2.0.
#
# The contained completion routines provide support for completing:
#
# *) local and remote branch names
# *) local and remote tag names

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

/*
* Add a shuffle function to Array object prototype
* Usage :
* var tmpArray = ["a", "b", "c", "d", "e"];
* tmpArray.shuffle();
*/
Array.prototype.shuffle = function (){
var i = this.length, j, temp;
if ( i == 0 ) return;
while ( --i ) {