Skip to content

Instantly share code, notes, and snippets.

# vim: set ft=python :
from __future__ import print_function
import json
import sys
import datetime
from redis import StrictRedis as Redis
@yellowled
yellowled / .htaccess
Created April 1, 2013 14:35
gzip aktivieren auf Uberspace
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE application/atom+xml \
application/javascript \
application/json \
application/rss+xml \
application/vnd.ms-fontobject \
application/x-font-ttf \
application/xhtml+xml \
application/xml \
font/opentype \
@abrookins
abrookins / gist:1933635
Created February 28, 2012 16:57
A Sublime Text 2 Django project file with a test runner build system
{
"folders":
[
{
"path": "django_project_dir"
},
{
"path": "lib/python2.7"
}
],
@yuvadm
yuvadm / fabfile.py
Created March 16, 2011 13:41
Fabric example for SSH keyfile connection
from fabric.api import *
env.hosts = ['host.name.com']
env.user = 'user'
env.key_filename = '/path/to/keyfile.pem'
def local_uname():
local('uname -a')
def remote_uname():
@specialunderwear
specialunderwear / meta.py
Last active July 22, 2019 12:12
Override model fields of an abstract model baseclass in django, by removing them from the abstract model.
def AbstractClassWithoutFieldsNamed(cls, *excl):
"""
Removes unwanted fields from abstract base classes.
Usage::
>>> from oscar.apps.address.abstract_models import AbstractBillingAddress
>>> from koe.meta import AbstractClassWithoutFieldsNamed as without
>>> class BillingAddress(without(AbstractBillingAddress, 'phone_number')):
... pass
@OALabs
OALabs / boxstarter_oalabs_x86vm.ps1
Last active December 17, 2022 22:03
Boxstarter - One click malware analysis tools installer for 32bit VM
Set-ExecutionPolicy Unrestricted;
iex ((New-Object System.Net.WebClient).DownloadString('http://boxstarter.org/bootstrapper.ps1'));
get-boxstarter -Force;
Install-BoxstarterPackage -PackageName 'https://gist.githubusercontent.com/OALabs/afb619ce8778302c324373378abbaef5/raw/4006323180791f464ec0a8a838c7b681f42d238c/oalabs_x86vm.ps1';
@schwuk
schwuk / forms.py
Created May 18, 2012 13:30
Including Email in the Django UserCreationForm
from django.forms import EmailField
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreationForm
class UserCreationForm(UserCreationForm):
email = EmailField(label=_("Email address"), required=True,
@malteos
malteos / german-iso-3166.csv
Last active September 27, 2023 09:23
German ISO-3166 Country Codes CSV (deutsche Ländercodes)
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
AF Afghanistan
EG Ägypten
AL Albanien
DZ Algerien
AD Andorra
AO Angola
AI Anguilla
AQ Antarktis
AG Antigua und Barbuda
GQ Äquatorial Guinea
@artero
artero / launch_sublime_from_terminal.markdown
Last active January 25, 2024 16:57 — forked from olivierlacan/launch_sublime_from_terminal.markdown
Launch Sublime Text 2 from the Mac OS X Terminal

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation

@DAddYE
DAddYE / hack.sh
Created March 19, 2012 11:31
OSX For Hackers
#!/bin/sh
##
# This is a script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# Run in interactive mode with:
# $ sh -c "$(curl -sL https://raw.github.com/gist/2108403/hack.sh)"
#
# or run it without prompt questions: