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
@MM.module 'EasterEggApp', (EE, App, Backbone, Marionette, $, _) -> | |
# up, up, down, down, left, left, right, right, a, enter | |
EE.sequence = [38, 38, 40, 40, 37, 37, 39, 39, 65, 13] | |
EE.pressed = [] | |
EE.on | |
'start': -> | |
$(window).on 'keyup.konami', EE.pressedKey | |
'stop': -> | |
$(window).off '.konami' |
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
<script src="components/get-style-property/get-style-property.js"></script> | |
<script src="components/get-size/get-size.js"></script> | |
<script src="components/matches-selector/matches-selector.js"></script> | |
<script src="components/eventEmitter/EventEmitter.js"></script> | |
<script src="components/eventie/eventie.js"></script> | |
<script src="components/doc-ready/doc-ready.js"></script> | |
<script src="components/classie/classie.js"></script> | |
<script src="components/jquery-bridget/jquery.bridget.js"></script> | |
<script src="components/outlayer/item.js"></script> | |
<script src="components/outlayer/outlayer.js"></script> |
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
function update() { | |
echo — Updating Homebrew... | |
brew update | |
echo — Upgrading Homebrew packages... | |
brew upgrade | |
echo — Cleaning up... | |
brew cleanup | |
echo - Pruning... | |
brew prune | |
echo — Updating MacPorts... |
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
# This is best when used in conjunction with the Injector chrome extension: | |
# http://neocotic.com/injector | |
# | |
# Add this snippet of code and launch Chrome or Canary in no sec mode: | |
# | |
# alias chrome-nosec="open /Applications/Google\ Chrome.app --args --disable-web-security --disable-prompt-on-repost" | |
# alias canary-nosec="open /Applications/Google\ Chrome\ Canary.app --args --disable-web-security --disable-prompt-on-repost" | |
# | |
# Then pretty much just keep your dev console open and everytime you visit a page in the SDB, the code will | |
# automatically reach out to the JellyNeo item database and tell you if anything in your SDB is worth over x nps. |
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
Util.encodeRFC5987 = (string) -> | |
encodeURIComponent(string) | |
# Note that although RFC3986 reserves "!", RFC5987 does not, | |
# so we do not need to escape it | |
.replace(/['()]/g, escape) | |
.replace(/\*/g, '%2A') | |
# The following are not required for percent-encoding per RFC5987, | |
# so we can allow for a little better readability over the wire: |`^ | |
.replace(/%(?:7C|60|5E)/g, unescape) |
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
⌘ ★ “ ” ‘ ’ ❝ ❞ ✔ × ✖ ✗ ✕ ⓧ ⊗ ⊕ ⊖ ⊙ ⊠ ⊡ ≠ ℻ © ® ← ↑ ↓ → ❮ ❯ ◄ ◂ ▸ ▷ ▹ ⌃ ¹ ² ³ ⁂ ▣ ⬚ Ⓜ ⓜ ⒨ ꟿ ṃ ♻ ♺ |
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
# Hide elements via selectors. | |
# | |
# Works wonderfully to block facebook ads which are | |
# pre-loaded ;o zomg | |
# | |
# Probably won't often update this gist, but selectors | |
# simply need to be added to @patterns | |
# | |
# You can avoid the transpile if you run this using | |
# the Injector, chrome extension. s'what I use. |
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
# Converts a data image uri to canvas image | |
# | |
# reader = new FileReader() | |
# reader.onload = (evt) => | |
# App.Util.dataToCanvas evt, el: @ui.thumb, width: 80, height: 40 | |
# reader.readAsDataURL(...) | |
# | |
# @ui.thumb = jquery selector | |
# ultimately the jquery dependency can be 86ed from this... | |
# |
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
# Returns an object with a new width and height | |
# constraining the proportions of the given max width | |
# and max height | |
# | |
# examples: | |
# Util.scaleProportion(200, 200, 2000, 2000); | |
# > Object {width: 200, height: 200} | |
# scaleProportion(200, 200, 2582, 2394) | |
# > Object {width: 200, height: 185} | |
# |
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
# Convert int|float from seconds into formatted | |
# duration timestamp | |
# | |
# deps: underscore or lodash or any other library | |
# that takes over window._ and provides a | |
# #.compact() method. dep could ultimately | |
# be removed... | |
# | |
# uses double bitwise not `~~` as `Math.floor` | |
# uses `+` as type coercion to `int` |