Skip to content

Instantly share code, notes, and snippets.

<!doctype html>
<!-- http://taylor.fausak.me/2015/01/27/ios-8-web-apps/ -->
<html>
<head>
<title>iOS 8 web app</title>
<!-- CONFIGURATION -->
@furf
furf / _.deep.js
Created July 30, 2012 17:06
underscore.js mixin for plucking nested properties
_.mixin({
// Get/set the value of a nested property
deep: function (obj, key, value) {
var keys = key.replace(/\[(["']?)([^\1]+?)\1?\]/g, '.$2').replace(/^\./, '').split('.'),
root,
i = 0,
n = keys.length;
@dleatherman
dleatherman / _radial-menu.scss
Created August 20, 2012 17:29
Sass-radial-menu markup
@import "compass/css3";
/*
* Sass-Radial-Menu v1.0a
* Sass+Compass Radial Menu Mixin
* http://permalightnyc.com/experiments/radial-menu
*
* Licensed under the MIT license.
* Copyright 2012 Dan Leatherman
*/
@sabithpocker
sabithpocker / something.md
Created September 2, 2012 05:26
Ember.js action helper and routing.

#Relevent parts to explain action, routes in Ember 1.0pre

##Action Helper The {{action}} helper registers an HTML element within a template for DOM event handling and forwards that interaction to the Application's router, the template's Ember.View instance, or supplied target option (see 'Specifiying a Target'). User interaction with that element will invoke the supplied action name on the appropriate target.

(Example without Router skipped, check helpers/action.js)

@ndarville
ndarville / business-models.md
Last active October 23, 2024 17:18
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
class @VideoProgressTracker
constructor: (@video) ->
@played_five_seconds = 0
@checkpoints = [0, 25, 50, 75, 95]
track: ->
@played_five_seconds += 1
@triggerCheckpoints(500 * @played_five_seconds / @duration)
start: ->
@kramer
kramer / gist:5496665
Created May 1, 2013 17:11
jQuery ajax request interceptor
$.ajaxSetup({
beforeSend: function (xhr) {
xhr.setRequestHeader('X-Bottle-CsrfToken', '{{ session.csrf }}')
}
});
@jed
jed / how-to-set-up-stress-free-ssl-on-os-x.md
Last active August 30, 2024 08:37
How to set up stress-free SSL on an OS X development machine

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying

@zspecza
zspecza / stylus-best-practices.md
Last active May 27, 2021 05:25
Stylus Best Practices

Stylus Best Practices

Introduction

This is a curated set of conventions and best practices for Stylus, an expressive, dynamic, robust and advanced CSS preprocessor. Frustrated with there not being a set of conventions set in place (that could be easily found), I set forth to find out on my own.

@tekiegirl
tekiegirl / uniqueId.adoc
Last active March 24, 2021 20:54
Using the graph to control unique id generation.

Using the graph to control unique id generation

Introduction

This gist was prompted by Nigel Small’s tweet of a query to generate a unique id for a node (and is posted here with his agreement). It inspired me to think about how it could be used in a full example, unrestricted by Twitter’s 140 characters. I have also looked at how we could generate different sets of unique ids for different labels.

Auto-incrementing #Neo4j counter MERGE (x:Counter {name:'foo'}) ON CREATE SET x.count = 0 ON MATCH SET x.count = x.count + 1 RETURN x.count

— Nigel Small (@technige) December 16, 2013