Skip to content

Instantly share code, notes, and snippets.

@whichlight
whichlight / art-demo-links.md
Last active August 29, 2015 14:02
materials for jsconf talk
@trey
trey / hubot-slack-heroku.md
Last active October 25, 2021 03:18
Steps to Install Hubot in Slack using Heroku
@squallstar
squallstar / Gruntfile.js
Last active January 10, 2016 11:10
Retina images with Grunt
//Grunt Spritesmith plugin
sprite: {
build: {
src: ['src/img/sprite/*.png'],
destImg: 'build/img/s-' + timestamp + '.png',
destCSS: 'src/scss/common/sprite.scss',
imgPath: '../img/s-' + timestamp + '.png',
algorithm: 'binary-tree',
engine: 'gm',
'engineOpts': {
@cobyism
cobyism / gh-pages-deploy.md
Last active September 29, 2025 14:15
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@EHLOVader
EHLOVader / RFCEmail.md
Last active April 13, 2023 02:31
Like Grammar Nazis I have run into misguided attempts to validate or use emails in applications enough that I put together this standard RFC email speech that i give to websites which fail on gmail plus notation email formats. Normally nothing changes, but maybe one day they will forward it to the right people and they will fix it.

I would like to note that your website restricts and disallows absolutely valid email addresses, in particular mine. I respectfully request that you update your sites email checks to allow valid email addresses which may not be particularly regular, but are absolutely valid.

I have included the requirements for email addresses along with their standards reference in RFC definitions.

  1. An e-mail address consists of local part and domain separated by an at sign (@) character (RFC 2822 3.4.1).

  2. The local part may consist of alphabetic and numeric characters, and the following characters: !, #, $, %, &, ', *, +, -, /, =, ?, ^, _, `, {, |, } and ~, possibly with dot separators (.), inside, but not at the start, end or next to another dot separator (RFC2822 3.2.4).

  3. The local part may consist of a quoted string—that is, anything within quotes ("), including spaces (RFC 2822 3.2.5).

@cowboy
cowboy / call-invo-cursion.js
Last active March 30, 2023 01:59
JavaScript: call invo-cursion?
// OOP
console.log( 'OHAI'.blink() );
// Call invocation
console.log( String.prototype.blink.call('OHAI') );
// $ always makes things look awesome.
var $ = Function.prototype.call;
// Very explicit call invocation
@ndarville
ndarville / business-models.md
Last active October 9, 2025 17:55
Business models based on the compiled list at http://news.ycombinator.com/item?id=4924647. I find the link very hard to browse, so I made a simple version in Markdown instead.

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google
@mbostock
mbostock / .block
Last active February 20, 2025 10:51
Gradient Along Stroke
license: gpl-3.0
@ibeex
ibeex / foo.log
Created August 4, 2012 13:46
Flask logging example
A warning occurred (42 apples)
An error occurred