Skip to content

Instantly share code, notes, and snippets.

Joe Bergantine bergantine

Block or report user

Report or block bergantine

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@bergantine
bergantine / pprint_list.py
Last active Aug 29, 2015
#python #pprint a #list
View pprint_list.py
import pprint
mylist = [ ... ]
with open('mylist_saved_to_a_file.py', 'w') as f:
pprint.pprint(mylist, f)
@bergantine
bergantine / .bash_profile
Created May 10, 2014
#Bash #profile for Mac with Git highlighting of staged and unstaged changes, output of current Git branch, output of Python virtualenv name.
View .bash_profile
# Customizations
# Aliases
alias ga='git add'
alias gb='git branch'
alias gco='git checkout'
alias gl='git pull'
alias gp='git push'
alias gst='git status'
alias gss='git status -s'
@bergantine
bergantine / execute via
Created Apr 17, 2014
Single-file Django site
View execute via
$ python project_name.py runserver
@bergantine
bergantine / genpass.py
Last active Feb 17, 2016
Safari-style #python #password Generator
View genpass.py
from random import choice
def genCode(len):
return ''.join([choice('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789') for i in range(len)])
print '%s-%s-%s-%s' % (genCode(3), genCode(3), genCode(3), genCode(3))
@bergantine
bergantine / __init__.py
Created Mar 2, 2014
__init__.py file for a #Django #tests directory to run any or each #test in that #directory (for Django < 1.6)
View __init__.py
import pkgutil
import unittest
for loader, module_name, is_pkg in pkgutil.walk_packages(__path__):
module = loader.find_module(module_name).load_module(module_name)
for name in dir(module):
obj = getattr(module, name)
if isinstance(obj, type) and issubclass(obj, unittest.case.TestCase):
exec ('%s = obj' % obj.__name__)
@bergantine
bergantine / Gruntfile.js
Last active Aug 29, 2015
package.json for Grunt-cli
View Gruntfile.js
module.exports = function(grunt) {
grunt.registerTask('watch', [ 'watch' ]);
grunt.initConfig({
less: {
style: {
files: {
"css/screen.css": "less/screen.less"
}
@bergantine
bergantine / Readme.md
Last active Apr 8, 2016
Vagrant config for Apache + mod_ssi
View Readme.md
@bergantine
bergantine / Vagrantfile
Last active Aug 29, 2015
Modifying django-newproj to use with Zurb Foundation
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "precise64"
# The url from where the 'config.vm.box' box will be fetched if it
# doesn't already exist on the user's system.
@bergantine
bergantine / Vagrantfile
Last active Jun 26, 2017
Vagrant box for Zurb development.
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "precise64-2"
# The url from where the 'config.vm.box' box will be fetched if it
@bergantine
bergantine / Vagrantfile
Last active Feb 15, 2020
Vagrant config for basic Python development
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "precise64"
# The url from where the 'config.vm.box' box will be fetched if it
# doesn't already exist on the user's system.
You can’t perform that action at this time.