Skip to content

Instantly share code, notes, and snippets.

View DanLipsitt's full-sized avatar

Dan Lipsitt DanLipsitt

  • Tempo Automation
  • United States
View GitHub Profile
@nathany
nathany / Vagrantfile
Created March 7, 2011 03:19
Vagrant Fabric experiment
Vagrant::Config.run do |config|
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "debian_squeeze_32"
# The url from where the 'config.vm.box' box will be fetched if it
# doesn't already exist on the user's system.
config.vm.box_url = "http://mathie-vagrant-boxes.s3.amazonaws.com/debian_squeeze_32.box"
# Assign this VM to a host only network IP, allowing you to access it via the IP.
config.vm.network "33.33.33.10"
# -*- mode: ruby -*-
# vi: set ft=ruby :
require "./fabric_provisioner.rb"
Vagrant::Config.run do |config|
# snip
config.vm.provision Vagrant::Provisioners::Fabric do |fab|
@sebmarkbage
sebmarkbage / DeepImmutableMutation.js
Created May 30, 2014 23:35
Deep Immutable Mutation Using Spread Operator
// Mutative
company.users.push({ name: 'New User' });
return company;
// Immutable
return { ...company, users: [ ...company.users, { name: 'New User' } ] };
// Implicit identifier
@ulyssesv
ulyssesv / settings.py
Last active January 20, 2016 06:02
Using Honcho to load env vars from a .env file
# -*- coding: utf-8 -*-
import os
if os.environ.get('READ_ENV', False):
from honcho.command import Honcho
h = Honcho()
entries = h.read_env(type('obj', (object,), {'env': '.env', 'app_root': os.path.abspath(os.path.dirname(os.path.dirname(__file__)))})())
h.set_env(entries)
@wutali
wutali / fabric.rb
Created July 10, 2012 12:30
Vagrant provisioner of Fabric.
module Vagrant
module Provisioners
class Fabric < Base
class Config < Vagrant::Config::Base
attr_accessor :fabfile_path
attr_accessor :fabric_path
attr_accessor :python_path
attr_writer :tasks
def _default_fabfile_path
@wilsaj
wilsaj / hello_soap_flask.py
Created February 23, 2011 19:37
Flask + Soaplib
import soaplib
from soaplib.core.service import rpc, soap, DefinitionBase
from soaplib.core.model.primitive import String, Integer
from soaplib.core.server import wsgi
from soaplib.core.model.clazz import Array
from flask import Flask
flask_app = Flask(__name__)
@egdelwonk
egdelwonk / Talk notes.md
Last active May 12, 2017 22:02
es2015 for python devs

Imports

Python:

import <module>
from <module> import defaultMember
from <module> import *
import <module> as <name>
@ziadsawalha
ziadsawalha / config.py
Created December 19, 2013 19:38
Python module Generic to parse command-line, environment, keyring, and config file options dynamically
"""
Configuration Parser
Configurable parser that will parse config files, environment variables,
keyring, and command-line arguments.
Example test.ini file:
###########
# Checks if the given cask needs to be upgraded.
#
#!/bin/bash
set -o pipefail
source /etc/profile
if [ $# -eq 0 ]; then
ARGS=($(brew cask list))
else
#!/bin/sh
# Check if the individual developer has his own hook
CMD_NAME=`basename $0`
if [ -f $GIT_DIR/hooks/personal/$CMD_NAME ]
then
# If so, run it. $@ passes all the command line arguments passed to this function
# If the personal hook fails, fail this one as well
if ! $GIT_DIR/hooks/personal/$CMD_NAME $@
then