Skip to content

Instantly share code, notes, and snippets.

@avelino
avelino / JGitUtil.java
Created December 20, 2019 01:24 — forked from porcelli/JGitUtil.java
jgit on bare repo
public static void delete(final Git git, final String branchName, final String path,
final String name, final String email, final String message, final TimeZone timeZone, final Date when) {
commit(git, branchName, path, null, name, email, message, timeZone, when);
}
public static void commit(final Git git, final String branchName, final String path, final File file,
final String name, final String email, final String message, final TimeZone timeZone, final Date when) {
final String gitPath = fixPath(path);
@avelino
avelino / happy_numbers.go
Last active August 29, 2015 14:20 — forked from dannluciano/happy_numbers.go
refactoring happy numbers in Go
package main
import (
"fmt"
"math"
)
func calc(number int, total *int) int {
if number == 0 {
return *total
@avelino
avelino / install_postgis_osx.sh
Created June 21, 2012 01:54 — forked from lucasallan/install_postgis_osx.sh
Installing PostGIS on Mac OS X and Ubuntu
# Some good references are:
# http://russbrooks.com/2010/11/25/install-postgresql-9-on-os-x
# http://www.paolocorti.net/2008/01/30/installing-postgis-on-ubuntu/
# http://postgis.refractions.net/documentation/manual-1.5/ch02.html#id2630392
#1. Install PostgreSQL postgis and postgres
brew install postgis
initdb /usr/local/var/postgres
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
curl -w '\nLookup time:\t%{time_namelookup}\nConnect time:\t%{time_connect}\nPreXfer time:\t%{time_pretransfer}\nStartXfer time:\t%{time_starttransfer}\n\nTotal time:\t%{time_total}\n' -o /dev/null -s 'http://gc.blog.br'
"""
A newforms widget and field to allow multiple file uploads.
Created by Edward Dale (www.scompt.com)
Released into the Public Domain
"""
from django.utils.encoding import force_unicode
from django.utils.datastructures import MultiValueDict
from django.utils.translation import ugettext