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 __future__ import unicode_literals | |
import os, sys, django | |
from theproject import settings | |
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'theproject.settings') | |
django.setup() | |
# now import normally, e.g. | |
from django.core.management.base import BaseCommand |
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
(defun my-temp-func () | |
(interactive) | |
(insert "tempura true")) | |
(define-minor-mode my-temp-mode | |
"throwaway minor mode for test" | |
:lighter " TEMP!" | |
:keymap (let ((map (make-sparse-keymap))) | |
(define-key map [(control return)] 'my-temp-func) | |
(define-key map (kbd "C-c f") 'my-temp-func) |
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 | |
# | |
# This script creates a working nix in $HOME | |
# ref https://github.com/pjotrp/nix-no-root | |
if [ $# -ne 1 ]; then | |
echo NEED NIX ROOT | |
exit 1 | |
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
import winrm | |
from winrm.protocol import Protocol | |
HOSTNAME='ec2-aaa-bbb-ccc-ddd.compute-1.amazonaws.com' | |
ENDPOINT='http://%s:5985/wsman' % HOSTNAME | |
USERNAME='Administrator' | |
PASSWORD='blahblah' | |
p = Protocol( | |
endpoint=ENDPOINT, |
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
;; messy but potentially useful | |
;; UTIL | |
(defn wrap-quote [s] | |
(str "\"" s "\"")) | |
(defn wrap-single-quote [s] | |
(str "'" s "'")) |
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
(setq copy-output-marker " # <EOF__>") | |
(defun execute-with-marker () | |
(interactive) | |
(kill-ring-save | |
(line-beginning-position) | |
(line-end-position)) | |
(end-of-line) | |
(setq my-comint-originator-buffer (buffer-name)) | |
(other-window 1) |
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
# see https://github.com/nix-community/nixbox/blob/master/scripts/configuration.nix | |
{ config, pkgs, ... }: | |
{ | |
imports = | |
[ # Include the results of the hardware scan. | |
./hardware-configuration.nix | |
./vagrant.nix | |
]; |
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
with import <nixpkgs> {}; | |
stdenv.mkDerivation rec { | |
name = "dev-env"; | |
env = pkgs.buildEnv { | |
name = name; | |
paths = buildInputs; | |
}; | |
buildInputs = [ | |
(vim_configurable.override { |
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
let | |
pkgs = import <nixpkgs> {}; | |
stdenv = pkgs.stdenv; | |
in stdenv.mkDerivation rec { | |
name = "quick"; | |
env = pkgs.buildEnv { name = name; paths = buildInputs; }; | |
buildInputs = [ | |
pkgs.python27Packages.virtualenv |
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 | |
if [ $# -lt 1 ]; then | |
cat <<EOF | |
Usage: $0 <directory> [tabwidth] | |
This script outputs a table of file information from the contents of <directory> like: | |
time type perm uid size mime hash path target | |
4444 file -rw- 0 1111 text/... abcd /x/f |
OlderNewer