This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;(function($) { | |
| $.fn.formset = function(opts) | |
| { | |
| var options = $.extend({}, $.fn.formset.defaults, opts), | |
| flatExtraClasses = options.extraClasses.join(' '), | |
| totalForms = $('#id_' + options.prefix + '-TOTAL_FORMS'), | |
| maxForms = $('#id_' + options.prefix + '-MAX_NUM_FORMS'), | |
| childElementSelector = 'input,select,textarea,label,div', | |
| $$ = $(this), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## | |
| # .bashrc | |
| ## | |
| export PGDATA='/usr/local/var/postgres' | |
| export PGHOST=localhost | |
| alias start-pg='pg_ctl -l $PGDATA/server.log start' | |
| alias stop-pg='pg_ctl stop -m fast' | |
| alias show-pg-status='pg_ctl status' | |
| alias restart-pg='pg_ctl reload' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # -- ******************************************************************************** | |
| # -- Description: Monitoring and sync script for identical remote folders | |
| # -- Version: 0.1 | |
| # -- Notes: Ony the folder on the server on which this script resides incurs | |
| # changes. Therefor, we only sync 1 way. | |
| # -- Requires: incron: sudo apt-cache search incron | |
| # using incrontab -e add the following: | |
| # /path/to/folder IN_CLOSE_WRITE /path/to/this/scrip.sh $@/$# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- mode: ruby -*- | |
| # vi: set ft=ruby : | |
| # All Vagrant configuration is done below. The "2" in Vagrant.configure | |
| # configures the configuration version (we support older styles for | |
| # backwards compatibility). Please don't change it unless you know what | |
| # you're doing. | |
| Vagrant.configure(2) do |config| | |
| config.vm.box = "ubuntu/trusty64" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* * * | |
| * takes any object as input and checks whether it's value is null. | |
| * null is the only primitive value that is 'falsy' but also returns | |
| * "object" from the typeof check. | |
| */ | |
| function is_null(obj) { | |
| return (!obj && typeof obj === "object"); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // oops, this would throw an error! | |
| if (DEBUG) { | |
| console.log( "Debugging is starting" ); | |
| } | |
| // this is a safe existence check | |
| if (typeof DEBUG !== "undefined") { | |
| console.log( "Debugging is starting" ); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| The way I like to do it is: | |
| 1. Unpack the official pre-built binaries into ~/.node (.e.g https://nodejs.org/dist/v0.12.7/node-v0 … x64.tar.gz would be unpacked in ~/.node/node-v0.12.7-linux-x64 | |
| 2. Add a symlink called current to your wanted node version (e.g. ln -s ~/.node/node-v0.12.7-linux-x64 ~/.node/current) | |
| 3. Add ~/.node/current/bin to your path (e.g echo export PATH=$HOME/.node/current/bin:$PATH >> ~/.bashrc) | |
| This way you can just type npm install whatever and it's installed into your local npm version that you have symlinked under ~/.node/current. | |
| If you want to change the version you're using, just point the symlink somewhere else. | |
| Recorded from: https://bbs.archlinux.org/viewtopic.php?pid=1556844#p1556844 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # file: ~/.profile | |
| case $- in | |
| *i*) | |
| # Interactive session. Try switching to bash. | |
| if [ -z "$BASH" ]; then # do nothing if running under bash already | |
| bash=$(command -v bash) | |
| if [ -x "$bash" ]; then | |
| export SHELL="$bash" | |
| exec "$bash" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # -- ******************************************************************************** | |
| # -- Description: Example case statements | |
| # -- Version: 0.1 | |
| # -- ******************************************************************************** | |
| case "$1" in | |
| hello) | |
| echo 'hello' | |
| ;; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| The air smells of rhubarb, occasional | |
| Roses, or first birth of blossoms, a fresh, | |
| Undulant hurt, so body snaps and curls | |
| Like flower. I step through snow as thin as script | |
| Watch white stars spin dizzy as drunks, and yearn | |
| To sleep beneath a patchwork quilt of rum. | |
| I want the slow, sure collapse of language | |
| Washed out by alcohol. Lovely Shelley, | |
| I have no use for measured, cadenced verse | |
| If you won’t read. Icarus-Iike, I’ll fall |