Provider | Singleton | Instantiable | Configurable |
---|---|---|---|
Constant | Yes | No | No |
Value | Yes | No | No |
Service | Yes | No | No |
Factory | Yes | Yes | No |
Decorator | Yes | No? | No |
Provider | Yes | Yes | Yes |
###Let's install Vagrant###
- Install VirtualBox: https://www.virtualbox.org/
- Install Vagrant: http://vagrantup.com/
###Select a Vagrant Box from https://vagrantcloud.com###
#add it to your list of boxes
vagrant box add hashicorp/precise32
#create a new folder for your project & init vagrant
This file contains 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
# WORKSPACE set to job workspace by jenkins/hudson | |
VENV="$WORKSPACE/.env" | |
if [ ! -e "$VENV" ]; then | |
virtualenv --python python2.6 --no-site-packages $VENV | |
elif [ ! -d "$VENV" ]; then | |
echo '$VENV exists but is not a directory' | |
exit 1 | |
fi |
This file contains 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
require 'io/console' | |
# Reads keypresses from the user including 2 and 3 escape character sequences. | |
def read_char | |
STDIN.echo = false | |
STDIN.raw! | |
input = STDIN.getc.chr | |
if input == "\e" then | |
input << STDIN.read_nonblock(3) rescue nil |
This file contains 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
# Sounder sounds for class | |
# Requires an active microphone to pick up anything | |
require 'ruby-processing' | |
class MinimTest < Processing::App | |
load_library "minim" | |
import "ddf.minim" | |
import "ddf.minim.analysis" | |
I just had to set up Jenkins to use GitHub. My notes (to myself, mostly):
For setting up Jenkins to build GitHub projects. This assumes some ability to manage Jenkins, use the command line, set up a utility LDAP account, etc. Please share or improve this Gist as needed.
- get both the git and github plugin
- http://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin
This file contains 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
import functools | |
import inspect | |
import os | |
import warnings | |
class _DeprecatedDecorator(object): | |
MESSAGE = "%s is @deprecated" | |
def __call__(self, symbol): |
This file contains 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
import functools | |
import inspect | |
import warnings | |
# NOTE(kgriffs): We don't want our deprecations to be ignored by default, | |
# so create our own type. | |
class DeprecatedWarning(UserWarning): | |
pass |
This file contains 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
# iterative implementation of binary search in Python | |
def binary_search(a_list, item): | |
"""Performs iterative binary search to find the position of an integer in a given, sorted, list. | |
a_list -- sorted list of integers | |
item -- integer you are searching for the position of | |
""" |
OlderNewer