Want to create a Gist from your editor, the command line, or the Services menu? Here's how.
This file contains hidden or 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
copy = function(str, mimetype) { | |
document.oncopy = function(event) { | |
event.clipboardData.setData(mimetype, str); | |
event.preventDefault(); | |
}; | |
document.execCommand("Copy", false, null); | |
} |
This file contains hidden or 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 Stack = function() { | |
return Object.create(Stack.prototype, { | |
_storage: { value: [], writable: false, configurable: false } | |
}); | |
}; | |
Stack.prototype = Object.create(null); | |
Stack.prototype.add = function(element) { | |
// ... |
This file contains hidden or 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
#depends on underscore | |
_.isConstructor = (thing) -> | |
if thing.name && thing.name[0].toUpperCase() == thing.name[0] | |
true | |
else | |
false | |
class Instrumentor | |
constructor: (namespace) -> |
This file contains hidden or 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
Show hidden characters
{ | |
"cmd": ["node", "$file"] | |
, "selector": "source.js" | |
, "path": "/usr/local/bin" | |
, "working_dir": "$project_path" | |
, "variants": | |
[ | |
{ | |
"name": "Run", | |
"cmd": ["js2coffee", "$file"], |
This file contains hidden or 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/sh | |
##################################################################### | |
# Program: git banish | |
##################################################################### | |
# Version: 1.0.0 | |
# Date: 2013-08-31 13:08:23 | |
# Author: Phillip Alexander (github.com/phillipalexander) | |
# | |
# Notes: See the excelent github article on this topic for more info | |
# https://help.github.com/articles/remove-sensitive-data |
This file contains hidden or 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 | |
import sys | |
import re | |
'''Read a Markdown file via standard input and tidy its | |
reference links. The reference links will be numbered in | |
the order they appear in the text and placed at the bottom | |
of the file.''' |
This file contains hidden or 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 parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |
This file contains hidden or 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 util = require('util'); | |
var path = require('path'); | |
var fs = require('fs'); | |
var allFiles = fs.readdirSync(process.cwd()) | |
var jsFiles = []; | |
for (var i = 0; i < allFiles.length ; i++) { | |
var selectedFile = allFiles[i]; | |
if (selectedFile.substr(selectedFile.length - 3) === '.js') { |
NOTE: This list is almost entirely copy/pasted from THIS awesome article. I've made my own personal edits (adding some additional content) which is why I keep it here.
Every day meanpath crawls over 200 million websites capturing the visible text, HTML source code, CSS and Javascript. This information is used by many companies to monitor the growth of web facing technology.