Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
| // Default mobile-first grid setup | |
| $total-columns : 4; // a 4-column fluid grid for anything less than tablet (<48em) | |
| $column-width : 20%; // each column is 4em wide | |
| $gutter-width : 3%; // 1em gutters between columns | |
| $grid-padding : $gutter-width; // grid-padding equal to gutters | |
| $tablet-columns : 10; // 10-column fluid grid for tablets - desktop (48em - <60em) | |
| $tablet-width : 48em; // 48em = 768px by default | |
| $tablet : $tablet-width $tablet-columns; // Shorthand for tablet breakpoint |
| {% macro form_field(field) -%} | |
| {% set with_label = kwargs.pop('with_label', False) %} | |
| {% set placeholder = '' %} | |
| {% if not with_label %} | |
| {% set placeholder = field.label.text %} | |
| {% endif %} | |
| <div class="control-group {% if field.errors %}error{% endif %}"> | |
| {% if with_label %} | |
| <label for="{{ field.id }}" class="control-label"> | |
| {{ field.label.text }}{% if field.flags.required %} *{% endif %}: |
| import gdata | |
| import json | |
| import requests | |
| # More examples: | |
| # https://github.com/millioner/Python-contact-importer/blob/master/contact_importer/providers/google.py | |
| # https://github.com/jtauber/django-friends/blob/master/friends/importer.py | |
| # GData with access token | |
| token = gdata.gauth.OAuth2Token( |
| // Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc | |
| // jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/ | |
| // author: Pawel Kozlowski | |
| var myApp = angular.module('myApp', []); | |
| //service style, probably the simplest one | |
| myApp.service('helloWorldFromService', function() { | |
| this.sayHello = function() { | |
| return "Hello, World!" |
| /* | |
| * Javascript time conversion script | |
| * version 1.0 | |
| * @requires jQuery | |
| * @author Modern Tribe, Inc. (Peter Chester) | |
| * | |
| * Converts several formats to a 2 point float. Accepted formats include: | |
| * 1.3333333333 | |
| * 1h 10m | |
| * 1:10 |
| // 2024 Update, use URLSearchParams [https://caniuse.com/urlsearchparams] | |
| export function createQueryString2(name: string, value: string, searchParams: any) { | |
| const params = new URLSearchParams(searchParams); | |
| params.set(name, value.toLowerCase()); | |
| return params.toString(); | |
| } | |
| // ---- Original 2012 version, when browsers really sucked ---- | |
| // Explicitly save/update a url parameter using HTML5's replaceState(). |
| <!doctype html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>App Redirection</title> | |
| </head> | |
| <body> | |
| <!-- | |
| NOTE: This was a great hack in days gone by, but now both Apple and Google have improved their support for custom | |
| protocol handlers. |
| var parser = document.createElement('a'); | |
| parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
| parser.protocol; // => "http:" | |
| parser.hostname; // => "example.com" | |
| parser.port; // => "3000" | |
| parser.pathname; // => "/pathname/" | |
| parser.search; // => "?search=test" | |
| parser.hash; // => "#hash" | |
| parser.host; // => "example.com:3000" |
| $sprites: sprite-map("sprites/*.png"); | |
| $sprites-retina: sprite-map("sprites-retina/*.png"); | |
| @mixin sprite-background($name) { | |
| background-image: sprite-url($sprites); | |
| background-position: sprite-position($sprites, $name); | |
| background-repeat: no-repeat; | |
| display: block; | |
| height: image-height(sprite-file($sprites, $name)); | |
| width: image-width(sprite-file($sprites, $name)); |
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)