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
window.console.loge = function(msg) { | |
var gifs = [ | |
'http://d1e3ezyatlol8u.cloudfront.net/img/212/doge-wink-212.gif', | |
'http://d1e3ezyatlol8u.cloudfront.net/img/212/doge-shake-space-212.gif', | |
'http://d1e3ezyatlol8u.cloudfront.net/img/212/doge-peepers-212.gif', | |
'http://d1e3ezyatlol8u.cloudfront.net/img/212/doge-prizza-212.gif', | |
'http://d1e3ezyatlol8u.cloudfront.net/img/212/doge-hat-212.gif', | |
'http://d1e3ezyatlol8u.cloudfront.net/img/212/doge-gradient-212.gif', | |
'http://d1e3ezyatlol8u.cloudfront.net/img/212/doge-fat-212.gif', | |
'http://d1e3ezyatlol8u.cloudfront.net/img/212/doge-rainbow-212.gif', |
This is an example of how to scaffold API endpoints to list / get / create / update / delete Posts in a Keystone website.
It's a modification of the default project created with the yo keystone
generator (see https://github.com/JedWatson/generator-keystone)
Gists don't let you specify full paths, so in the project structure the files would be:
routes-index.js --> /routes/index.js // modified to add the api endpoints
routes-api-posts.js --> /routes/api/posts.js // new file containing the Post API route controllers
I tried a few different techniques to make a GIF via command-line and the following gives me the best control of quality and size. Once you're all setup, you'll be pumping out GIFs in no time!
Install FFmpeg
- $ brew install ffmpeg [all your options]
- Example: $ brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-frei0r --with-libass --with-libvo-aacenc --with-libvorbis --with-libvpx --with-opencore-amr --with-openjpeg --with-opus --with-rtmpdump --with-schroedinger --with-speex --with-theora --with-tools
Install ImageMagick
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
.prettyprint .str, code .str { color: #a9758c; } /* string */ | |
.prettyprint .kwd, code .kwd { color: #d58840; } /* keyword */ | |
.prettyprint .com, code .com { color: #767979; font-style: italic; } /* comment */ | |
.prettyprint .typ, code .typ { color: #80aac6; } /* type */ | |
.prettyprint .lit, code .lit { color: #ac758c; } /* literal */ | |
.prettyprint .pun, code .pun { color: #fff; } /* punctuation */ | |
.prettyprint .pln, code .pln { color: #fff; } /* plaintext */ | |
.prettyprint .tag, code .tag { color: #fecf84; } /* html/xml tag */ | |
.prettyprint .atn, code .atn { color: #ce8a45; } /* html/xml attribute name */ | |
.prettyprint .atv, code .atv { color: #b2c869; } /* html/xml attribute value */ |
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
// Handlebars Localisation Helper | |
// Source: https://gist.github.com/tracend/3261055 | |
Handlebars.registerHelper('l10n', function(keyword) { | |
var lang = (navigator.language) ? navigator.language : navigator.userLanguage; | |
// pick the right dictionary (if only one available assume it's the right one...) | |
var locale = window.locale[lang] || window.locale['en-US'] || window.locale || false; | |
// exit now if there's no data | |
if( !locale ) return target; |
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 data = "do shash'owania"; | |
var crypto = require('crypto'); | |
crypto.createHash('md5').update(data).digest("hex"); |
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
// goes with Boris Smus's keysocket extension <https://github.com/borismus/keysocket/> | |
var PREV = 20; | |
var PLAY = 16; | |
var NEXT = 19; | |
var fake_prev_el = document.createElement('div'); | |
fake_prev_el.id = "fake_prev_el"; | |
fake_prev_el.style.height = 0; | |
fake_prev_el.style.width = 0; |
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
The MIT License (MIT) | |
Copyright (c) James Dennes | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
NewerOlder