Skip to content

Instantly share code, notes, and snippets.

@idleberg
idleberg / atom-macos-context-menu.md
Last active April 27, 2022 00:37
“Open in Atom” in macOS context-menu

Open in Atom

  • Open Automator
  • Create a new Service
  • Set “Service receives selected” to files or folders in any application
  • Add a Run Shell Script action
  • Set the script action to /usr/local/bin/atom -n "$@"
  • Set “Pass input” to as arguments
  • Save as Open in Atom
@ericelliott
ericelliott / custom-iterable.js
Last active July 23, 2018 23:29
JavaScript custom iterable
const countToThree = {
a: 1,
b: 2,
c: 3
};
countToThree[Symbol.iterator] = function* () {
const keys = Object.keys(this);
const length = keys.length;
@fiveisprime
fiveisprime / quick-start
Last active October 23, 2015 15:26
Modulus Meteor Quickstart
$ meteor create --example leaderboard
$ cd leaderboard
$ modulus project create leaderboard -r node.js -s 512
$ modulus env set ROOT_URL $(modulus project list | grep leaderboard | awk '{print $4}') -p leaderboard
$ modulus addons add mongo:base -p leaderboard
$ modulus deploy -p leaderboard
# zsh
EMOJI=(💩 🐦 🚀 🐞 🎨 🍕 🐭 👽 ☕️ 🔬 💀 🐷 🐼 🐶 🐸 🐧 🐳 🍔 🍣 🍻 🔮 💰 💎 💾 💜 🍪 🌞 🌍 🐌 🐓 🍄 )
function random_emoji {
echo -n "$EMOJI[$RANDOM%$#EMOJI+1]"
}
PROMPT="$(random_emoji) "
RPROMPT='%c'
@jesterswilde
jesterswilde / SpriteSheetRenderer.ms
Created February 8, 2015 15:25
Renders a sprite sheet from 3DS Max and kicks it to Unity
--Sprite Sheet Renderer by Corey Wolff
--Currently this is setup to use automatically spit out a sprite sheet to a specific location based on the
--CreateProject and CreateAsset script I made. It also wants to then have Unity chop up the sprite sheet.
--If people are intersted I could modify this to be a more generic version.
studioLib()
drvLibGame()
(function() {
// Do not use this library. This is just a fun example to prove a
// point.
var Bloop = window.Bloop = {};
var mountId = 0;
function newMountId() {
return mountId++;
}
@bgrins
bgrins / export-chrome-bookmarks.js
Last active February 26, 2024 04:00
Reminder of how to export bookmarks from Chrome as text.
/*
Export bookmarks from Chrome as text.
Go to Bookmarks Manager->Organize->Export to HTML file.
Then open that file, open console and run this command:
*/
[].map.call(document.querySelectorAll("dt a"), function(a) {
return a.textContent + " - " + a.href
}).join("\n");
@JeffreyWay
JeffreyWay / gist:1525217
Created December 27, 2011 21:29
Instant Server for Current Directory
alias server='open http://localhost:8000 && python -m SimpleHTTPServer'
@trevmex
trevmex / bst.js
Created February 11, 2011 05:38
A simple binary search tree in JavaScript
/*
* File: bst.js
*
* A pure JavaScript implementation of a binary search tree.
*
*/
/*
* Class: BST
*