Setting up virtualenv and activating it
$ virtualenv venv --distribute
New python executable in venv/bin/python
Installing distribute.........done.
Installing pip................done.
$ source venv/bin/activate
(venv)$ python| # Change Prompt | |
| # ------------------------------------------------------------ | |
| export NVM_DIR="$HOME/.nvm" | |
| [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm | |
| [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion | |
| GIT_PROMPT_ONLY_IN_REPO=1 | |
| if [ -f "$(brew --prefix)/opt/bash-git-prompt/share/gitprompt.sh" ]; then | |
| __GIT_PROMPT_DIR=$(brew --prefix)/opt/bash-git-prompt/share |
| # tests done on an ubuntu vm | |
| concat 1.65812611580 milliseconds | |
| append 0.07023715973 milliseconds | |
| list comprehension 0.03012800217 milliseconds | |
| list range 0.00904202461 milliseconds |
| #!/bin/bash | |
| ################################################################################################# | |
| # A simple script to set time and date on a ubuntu server # | |
| # # | |
| # Adapted from this short article: # | |
| # https://www.garron.me/en/linux/set-time-date-timezone-ntp-linux-shell-gnome-command-line.html # | |
| # # | |
| # How to run: # | |
| # 'sudo bash set_time_date.sh' # |
| # ~/.bashrc: executed by bash(1) for non-login shells. | |
| # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
| # for examples | |
| # If not running interactively, don't do anything | |
| case $- in | |
| *i*) ;; | |
| *) return;; | |
| esac |
| $ sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable | |
| $ sudo apt-get update | |
| $ sudo apt-get install gdal-bin |
| // the original Animal class and sayName method | |
| function Animal(name, numLegs) { | |
| this.name = name; | |
| this.numLegs = numLegs; | |
| } | |
| Animal.prototype.sayName = function() { | |
| console.log("Hi my name is " + this.name); | |
| }; |
Setting up virtualenv and activating it
$ virtualenv venv --distribute
New python executable in venv/bin/python
Installing distribute.........done.
Installing pip................done.
$ source venv/bin/activate
(venv)$ python| a = new Array(); | |
| for (var b = 0; b < 10; b++) { | |
| a[0] |= b; // <= ? | |
| } |
| 'use strict'; | |
| var chai = require('chai'), | |
| expect = chai.expect, | |
| sinon = require('sinon'), | |
| sinonChai = require('sinon-chai'); | |
| var Backbone = require('backbone'); | |
| var _ = require('lodash/dist/lodash.underscore'); |
| 'use strict'; | |
| var expect = require('chai').expect; | |
| var jsdom = require('jsdom'); | |
| var jquery = require('jquery'); // option 2 | |
| var TodoView = require('../hello-backbone/views/todo-view'); | |
| describe('Backbone.View', function() { | |
| var $, todoView; // option 1 |