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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
function PostScriptNameRenderer(element) { | |
return element ? element.postScriptName : undefined; | |
} | |
function getFont(renderer) { | |
var list = app.fonts; | |
var result = []; | |
var name; | |
var i; | |
if (renderer) { |
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
var characters = [ | |
{ | |
"user" : "mario", | |
"age" : 23, | |
"good" : true | |
}, | |
{ | |
"user" : "luigi", | |
"age" : 21, | |
"good" : true |
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
@echo off | |
SET st2Path=C:\Program Files\Sublime Text 2\sublime_text.exe | |
rem add it for all file types | |
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 2" /t REG_SZ /v "" /d "Open with Sublime Text 2" /f | |
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 2" /t REG_EXPAND_SZ /v "Icon" /d "%st2Path%,0" /f | |
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 2\command" /t REG_SZ /v "" /d "%st2Path% \"%%1\"" /f | |
rem add it for folders | |
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 2" /t REG_SZ /v "" /d "Open with Sublime Text 2" /f |
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
<dict> | |
<key>name</key> | |
<string>GitGutter deleted</string> | |
<key>scope</key> | |
<string>markup.deleted.git_gutter</string> | |
<key>settings</key> | |
<dict> | |
<key>foreground</key> | |
<string>#F92672</string> | |
</dict> |
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
function sha1() { | |
function random() { | |
var characters = "abcdef0123456789"; | |
return (function () { | |
var index = Math.floor(Math.random() * characters.length); | |
return characters.charAt(index); | |
})(); | |
} | |
var MAX_LENGTH = 40; |
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
function shuffle(array) { | |
var counter = array.length - 1; | |
var tmp; | |
var index; | |
for (; counter > 0; counter--) { | |
index = Math.floor(Math.random() * counter); | |
tmp = array[counter]; | |
array[counter] = array[index]; | |
array[index] = tmp; | |
} |
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/python env | |
import abc | |
import unittest | |
class StringUtilities(object): | |
@staticmethod | |
def is_palindrome(s): | |
if not isinstance(s, str): |
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
from datetime import datetime | |
import csv | |
import math | |
import sys | |
import time | |
class Record(object): | |
EARTH_RADIUS_IN_KM = 6371 |
OlderNewer