Skip to content

Instantly share code, notes, and snippets.

@camdez
camdez / breaktime.el
Last active August 29, 2015 14:28
/u/joeheyming's Emacs break timer (modified)
;;; See: https://www.reddit.com/r/emacs/comments/3icpo7/take_a_break_every_3_hours/
(defvar breaktime-timer nil
"Holds the running break timer (if any).")
(defvar breaktime-interval (* 3 60 60)
"How often to take a break, in seconds.")
(defun breaktime--take-a-break ()
(interactive)
(switch-to-buffer (get-buffer-create "*breaktime*"))
(let ((inhibit-read-only t))
(use '(incanter core processing))
;; simple interactive Processing example taken from processingjs.org website:
;; http://processingjs.org/source/basic-example/processingjs_basic-example.html
;; set up variable references to use in the sketch object
(let [radius (ref 50.0)
X (ref nil)
Y (ref nil)
@johnjohndoe
johnjohndoe / gist:723302
Created December 1, 2010 10:27
Colored bash prompt showing git branch (.bash_rc)
# Set git tab completion and PS1 integration
if [ -f /usr/local/git/contrib/completion/git-completion.bash ]; then
. /usr/local/git/contrib/completion/git-completion.bash
fi
GIT_PS1_SHOWDIRTYSTATE=true
if [ -f /opt/local/etc/bash_completion ]; then
. /opt/local/etc/bash_completion
fi
@tjhanley
tjhanley / xcodeversionr.sh
Created February 23, 2011 21:55
command line utility to write the version number and the git commit hash to your projects Bundle Version Id
#!/usr/bin/env bash
# place this in your path somewhere
# usage xcodeversionr.sh 1.0.1 MyProject-Info.plist
echo "Version: $1"
echo "File: $2"
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $1 (build `git rev-parse --short HEAD`)" $2
@mrenouf
mrenouf / git_merge_meld.sh
Created September 28, 2011 10:09
Merge helper script for using 'git mergetool' with meld, fixes http://stackoverflow.com/questions/7501666/
#!/bin/bash
# Handles proper use of Meld from Git.
#
# Instead of launching meld with $MERGED as the base revision, this
# script makes a copy of $BASE and handles copying the result back
# to $MERGED if the result was saved.
# As an extra tweak, it also presents branch names (if known) as
# the file name prefix, instead of just "LOCAL" and "REMOTE".
@miku
miku / worldclock.sh
Created October 18, 2011 08:22
Worldclock for bash.
worldclock() {
ADDIS_ABABA=`TZ=Africa/Addis_Ababa date +"%c (%z %Z)"`
BERLIN=`TZ=Europe/Berlin date +"%c (%z %Z)"`
CHICAGO=`TZ=America/Chicago date +"%c (%z %Z)"`
HONK_KONG=`TZ=Asia/Hong_Kong date +"%c (%z %Z)"`
LONDON=`TZ=Europe/London date +"%c (%z %Z)"`
LOS_ANGELES=`TZ=America/Los_Angeles date +"%c (%z %Z)"`
MOSCOW=`TZ=Europe/Moscow date +"%c (%z %Z)"`
NEW_YORK=`TZ=America/New_York date +"%c (%z %Z)"`
SOFIA=`TZ=Europe/Sofia date +"%c (%z %Z)"`
@lclarkmichalek
lclarkmichalek / gist:1657284
Created January 22, 2012 14:52
Flymake mode for golang
(require 'flymake)
(defvar go-compiler "8g")
(defun flymake-go-init ()
(let* ((temp-file (flymake-init-create-temp-buffer-copy
'flymake-create-temp-inplace))
(local-file (file-relative-name
temp-file
(file-name-directory buffer-file-name))))
;; The 10 Scala one-liners tranlated to Clojure.
;; http://mkaz.com/solog/scala/10-scala-one-liners-to-impress-your-friends.html
;; Oh, there are more of them:
;; Python: http://codeblog.dhananjaynene.com/2011/06/10-python-one-liners-to-impress-your-friends/
;; Ruby: http://programmingzen.com/2011/06/02/10-ruby-one-liners-to-impress-your-friends/
;; CoffeeScript: http://ricardo.cc/2011/06/02/10-CoffeeScript-One-Liners-to-Impress-Your-Friends.html
;; Another Clojure version: http://freegeek.in/blog/2011/06/10-clojure-one-liners/
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@chrisyip
chrisyip / Monokai.tmTheme
Created May 7, 2012 13:36
Monokai for Sublime Text: markdown supported
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Monokai</string>
<key>settings</key>
<array>
<dict>
<key>settings</key>
@monkstone
monkstone / processing.xml
Created October 24, 2012 14:55
A jEdit Commando File for processing
<?xml version="1.0"?>
<!DOCTYPE COMMANDO SYSTEM "commando.dtd"><!-- processing commando -->
<!-- Monkstone, 2012-Nov-2 -->
<COMMANDO>
<UI>
<CAPTION LABEL="Run Processing">
<FILE_ENTRY LABEL="pde file" VARNAME="pde" EVAL="MiscUtilities.getParentOfPath(buffer.getPath())"/>
</CAPTION>
<CAPTION LABEL="Path to processing-java">