start new:
tmux
start new with session name:
tmux new -s myname
| #!/bin/bash | |
| # Download it. | |
| # Name it as 'theme' | |
| # Place it in /usr/bin/ | |
| # shell_prompt$ theme | |
| echo ' | |
| 3024 Day ( 1) 3024 Night ( 2) AdventureTime ( 3) | |
| Afterglow ( 4) AlienBlood ( 5) Argonaut ( 6) | |
| Arthur ( 7) Atom ( 8) Belafonte Day ( 9) | |
| Belafonte Night ( 10) BirdsOfParadise ( 11) Blazer ( 12) |
| /** | |
| * Angular needs to send the Rails CSRF token with each post request. | |
| * | |
| * Here we get the token from the meta tags (make sure <%= csrf_meta_tags %> | |
| * is present in your layout.) | |
| */ | |
| angular.module('myapp',[]). | |
| // configure our http requests to include the Rails CSRF token | |
| config(["$httpProvider", function(p) { | |
| var m = document.getElementsByTagName('meta'); |
| This playbook has been removed as it is now very outdated. |
This gist is no longer valid. Please see Compass-Rails for instructions on how to install.
| function color_meter(cwith, ccolor) { | |
| if (!cwith && !ccolor) return; | |
| var _cwith = (cwith.charAt(0)=="#") ? cwith.substring(1,7) : cwith; | |
| var _ccolor = (ccolor.charAt(0)=="#") ? ccolor.substring(1,7) : ccolor; | |
| var _r = parseInt(_cwith.substring(0,2), 16); | |
| var _g = parseInt(_cwith.substring(2,4), 16); | |
| var _b = parseInt(_cwith.substring(4,6), 16); |
Looking at the ES5 compatibility table, several browsers provide everything often used (i. e. not Object.freeze() and friends) except Function.prototype.bind. So I just inline that. Browsers that don't provide other functions also don't include Object.getOwnPropertyNames, so I used it as my test for including the entire shim.
Note that I haven't tested it yet, and it doesn't work for the six Object functions next to each other in the Safari 5 part of the compatibility chart (Safari 5 is deemed good enough).
Update: I added JSON for IE <= 7. JSON is used in a good number of node.js modules.
| function onclick(e) { | |
| var range; | |
| if (document.caretRangeFromPoint) { | |
| range = document.caretRangeFromPoint(e.pageX, e.pageY); | |
| } else if (e.rangeParent) { | |
| range = document.createRange(); | |
| range.setStart(e.rangeParent, e.rangeOffset); | |
| } | |
| var textContainer = range.startContainer; |