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
# csv_import_users.rake | |
# Bulk user provisioning for Redmine using CSV file | |
# Copyright (C) 2010 - Adrian Perez <adrianperez.deb@gmail.com> | |
# Licensed under GPL 3. | |
require 'csv' | |
namespace :redmine do | |
task :csv_import_users => :environment do | |
@first_row = true |
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
from itertools import tee, izip | |
from django.contrib.gis.db import models | |
from django.contrib.gis.measure import Distance | |
from geopy.distance import distance as geopy_distance | |
def pairwise(iterable): | |
"s -> (s0,s1), (s1,s2), (s2, s3), ..." | |
a, b = tee(iterable) |
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
/* | |
Create a console app, add references to the various white libraries and use the following as a template for operating the Open Dialog window | |
Get the white binaries from here: http://white.codeplex.com/ | |
*/ | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Windows.Automation; | |
using White.Core; | |
using White.Core.UIItems; |
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
# Generic build script that builds, tests, and creates nuget packages. | |
# | |
# INSTRUCTIONS: | |
# Update the following project paths: | |
# proj Path to the project file (.csproj) | |
# test Path to the test project (.csproj) | |
# nuspec Path to the package definition for NuGet. | |
# | |
# delete any of the lines if not applicable | |
# |
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
# ~/.gitconfig | |
[branch] | |
autosetupmerge = true | |
[push] | |
default = current | |
[core] | |
excludesfile = .gitignore |
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
#!/bin/bash | |
## in .bash_profile | |
SSHAGENT=`which ssh-agent` | |
SSHAGENTARGS="-s" | |
if [ -z "$SSH_AUTH_SOCK" -a -x "$SSHAGENT" ]; then | |
eval `$SSHAGENT $SSHAGENTARGS` | |
trap "kill $SSH_AGENT_PID" 0 | |
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
{% load crispy_forms_field %} | |
<div id="div_{{ field.auto_id }}" class="control-group{% if form_show_errors and field.errors %} error{% endif %} {% if field.field.widget.attrs.class %} {{ field.field.widget.attrs.class }}{% endif %}"> | |
{% if field.label %} | |
<label for="{{ field.id_for_label }}" class="control-label {% if field.field.required %}requiredField{% endif %}"> | |
{{ field.label|safe }}{% if field.field.required %}<span class="asteriskField">*</span>{% endif %} | |
</label> | |
{% endif %} |
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
var system = require('system'); | |
if (system.args.length < 5) { | |
console.info("You need to pass in account name, username, password, and path to casperJS as arguments to this code."); | |
phantom.exit(); | |
} | |
var account = system.args[1]; | |
var username = system.args[2]; | |
var password = system.args[3]; |
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
""" | |
Two things are wrong with Django's default `SECRET_KEY` system: | |
1. It is not random but pseudo-random | |
2. It saves and displays the SECRET_KEY in `settings.py` | |
This snippet | |
1. uses `SystemRandom()` instead to generate a random key | |
2. saves a local `secret.txt` |
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
///$tab Redmine | |
SET ThousandSep=' '; | |
SET DecimalSep=','; | |
SET MoneyThousandSep='.'; | |
SET MoneyDecimalSep=','; | |
SET MoneyFormat='#.##0,00 kr;-#.##0,00 kr'; | |
SET TimeFormat='hh:mm:ss'; | |
SET DateFormat='YYYY-MM-DD'; | |
SET TimestampFormat='YYYY-MM-DD hh:mm:ss[.fff]'; | |
SET MonthNames='jan;feb;mar;apr;maj;jun;jul;aug;sep;okt;nov;dec'; |
OlderNewer