Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| void function() {//closure | |
| var global = this | |
| , _initKeyboardEvent_type = (function( e ) { | |
| try { | |
| e.initKeyboardEvent( | |
| "keyup" // in DOMString typeArg | |
| , false // in boolean canBubbleArg | |
| , false // in boolean cancelableArg | |
| , global // in views::AbstractView viewArg |
| /* The Grid ---------------------- */ | |
| .lt-ie9 .row { width: 940px; max-width: 100%; min-width: 768px; margin: 0 auto; } | |
| .lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; } | |
| .lt-ie9 .row.large-collapse .column, | |
| .lt-ie9 .row.large-collapse .columns { padding: 0; } | |
| .lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; } | |
| .lt-ie9 .row .row.large-collapse { margin: 0; } | |
| .lt-ie9 .column, .lt-ie9 .columns { float: left; min-height: 1px; padding: 0 15px; position: relative; } | |
| .lt-ie9 .column.large-centered, .columns.large-centered { float: none; margin: 0 auto; } |
| // Stick all your icons in a subfolder in your images folder. Put retina versions in a subfolder of that called "@2x". | |
| $sprites: sprite-map("NAME_OF_SUBFOLDER/*.png"); | |
| $sprites2x: sprite-map("NAME_OF_SUBFOLDER/@2x/*.png"); | |
| // stolen from 37signals | |
| @mixin retina-media() { | |
| @media (min--moz-device-pixel-ratio: 1.3), | |
| (-webkit-min-device-pixel-ratio: 1.3), | |
| (min-device-pixel-ratio: 1.3), | |
| (min-resolution: 1.3dppx) { |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| # | |
| # Working with branches | |
| # | |
| # Get the current branch name (not so useful in itself, but used in | |
| # other aliases) | |
| branch-name = "!git rev-parse --abbrev-ref HEAD" | |
| # Push the current branch to the remote "origin", and set it to track | |
| # the upstream branch | |
| publish = "!git push -u origin $(git branch-name)" |
| /** | |
| * Example of using an angular provider to build an api service. | |
| * @author Jeremy Elbourn (@jelbourn) | |
| */ | |
| /** Namespace for the application. */ | |
| var app = {}; | |
| /******************************************************************************/ |
| // data comes from here http://stat-computing.org/dataexpo/2009/the-data.html | |
| // download 1994.csv.bz2 and unpack by running: cat 1994.csv.bz2 | bzip2 -d > 1994.csv | |
| // 1994.csv should be ~5.2 million lines and 500MB | |
| // importing all rows into leveldb took ~50 seconds on my machine | |
| // there are two main techniques at work here: | |
| // 1: never create JS objects, leave the data as binary the entire time (binary-split does this) | |
| // 2: group lines into 16 MB batches, to take advantage of leveldbs batch API (byte-stream does this) | |
| var level = require('level') |
Earlier, amidst many other tweets about a new css preprocessor, Myth, I tweeted "Avoid snake oil, people. It takes more than a pretty website and a good marketing message. You have to actually deliver code that works." to which @necolas replied "assume your peers have good intentions".
Absolutely. This is sound life advice. I endeavor to do this and the message I wanted to convey to everyone today could have been conveyed without resorting to using such negative phrases as "snake oil". So to the guys at Segment.io and especially to Ian Storm Taylor, I'd like to say I'm sorry. I was frustrated, but that doesn't excuse that tweet.
I'd like to talk briefly about why I was so frustrated.
Even people with great intentions can still do harm. Recently a nice guy decided he would give away a thousand dollars by ["making it rain" dollars at a mall](http://abclocal.go.com/kabc/sto
When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:
const Article = require('../../../../app/models/article');Those suck for maintenance and they're ugly.
| angular.module('myMdl', []).config(['$httpProvider', function($httpProvider) { | |
| $httpProvider.responseInterceptors.push([ | |
| '$q', '$templateCache', 'activeProfile', | |
| function($q, $templateCache, activeProfile) { | |
| // Keep track which HTML templates have already been modified. | |
| var modifiedTemplates = {}; | |
| // Tests if there are any keep/omit attributes. | |
| var HAS_FLAGS_EXP = /data-(keep|omit)/; |