Skip to content

Instantly share code, notes, and snippets.

View dln's full-sized avatar
🚀

Daniel Lundin dln

🚀
View GitHub Profile
%!PS
%
% @file mandelbrot.ps
% @author Mitch Richling <http://www.mitchr.me/>
% @Copyright Copyright 2002 by Mitch Richling. All rights reserved.
% @brief This is a PostScript program to compute the Mandelbrot set.@EOL
% @Keywords mandelbrot postscript
% @Std ps
/XMAX 504 def % Width of image
@dln
dln / clusters.aurora
Last active October 21, 2015 13:41
Parameterized jobs in Aurora
CLUSTERS = [
'dc1.example.com',
'dc2.example.com',
'dc3.example.com',
'dc4.example.com',
'dc5.example.com',
'dc6.example.com',
]
@dln
dln / build-pex.sh
Last active November 30, 2017 10:10
#!/bin/bash
set -ex
rm -rf build
mkdir build
python -m virtualenv ./build/venv/
./build/venv/bin/pip install --upgrade wheel pex setuptools
./build/venv/bin/python setup.py bdist_wheel
./build/venv/bin/pex --cache-dir build/pex-cache --repo dist/ -r myprogram -e myprogram:main -o dist/myprogram
REPO=http://archive.cloudera.com/cdh5/ubuntu/trusty/amd64/cdh
# Add apt repo
wget $REPO/cloudera.list -O /etc/apt/sources.list.d/cloudera.list
wget -qO - $REPO/archive.key | sudo apt-key add -
# Prioritize cloudera repo
cat <<EOF > /etc/apt/preferences.d/cloudera.pref
Package: *
Pin: release o=Cloudera, l=Cloudera
VENV=$HOME/.python-env
virtualenv $VENV
$VENV/bin/pip install awscli
export PATH=$VENV/bin:$PATH
@dln
dln / jellohack.c
Created June 2, 2014 20:50
Hack for xscreensaver I did a long time ago.
/* A screen saver hack to display the CodeFactory logotype
* in a jiggling fashion with a lil bit o bounce... *grin*
*
* Daniel Lundin <daniel@codefactory.se>
*
* Copyright 2001 Seven relatively short dudes and a pale chick
*
* This software is released under Disgruntled Catholic License v6.66
* Redistribution prohibited without authorization from the pope.
* Under special circumstances under which should such authorization
#!/bin/bash
#
# Set up user-wide:
#
# 1) Copy this file to ~/.git_template/hooks/pre-commit
# 2) git config --global init.templatedir '~/.git_template'
# 3) New repos will initialize from template. Use 'git init' on existing repos to install manually.
#
# Conflict markers
#!/bin/bash
# Watch paths (given as arguments), automatically build when something changes.
# The script does a couple opinionated things to make my life easier:
#
# * Terminal scrollbuffer is reset before each iteration, simplifying scrolling.
# * I use a filter script to colorize gcc output (clang errors would be nicer).
# * Output is copied to a log file (/tmp/build.log).
# - I open this file in Sublime or vim, which reloads the file on change (each build).
#
# Usage:
#!bash
#
# bash/zsh completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
# Distributed under the GNU General Public License, version 2.0.
#
# The contained completion routines provide support for completing:
#
@dln
dln / dln github.icls
Created February 12, 2014 14:16
intellij color scheme
<?xml version="1.0" encoding="UTF-8"?>
<scheme name="dln github" version="124" parent_scheme="Default">
<option name="LINE_SPACING" value="1.29" />
<font>
<option name="EDITOR_FONT_NAME" value="Ubuntu Mono Unhinted" />
<option name="EDITOR_FONT_SIZE" value="16" />
</font>
<font>
<option name="EDITOR_FONT_NAME" value="Ubuntu Mono" />
<option name="EDITOR_FONT_SIZE" value="16" />