Skip to content

Instantly share code, notes, and snippets.

View colonelpanic8's full-sized avatar

Ivan Malison colonelpanic8

View GitHub Profile
anonymous
anonymous / go-template-mode.el
Created January 21, 2012 21:33
Go template mode
;;; go-template-mode.el --- Major mode for Go template language
;;; Commentary:
;; 1) Copy this file somewhere in your Emacs `load-path'. To see what
;; your `load-path' is, run inside emacs: C-h v load-path<RET>
;;
;; 2) Add the following to your .emacs file:
;;
;; (require 'go-template-mode)
@ryin
ryin / tmux_local_install.sh
Last active April 23, 2024 01:06
bash script for installing tmux without root access
#!/bin/bash
# Script for installing tmux on systems where you don't have root access.
# tmux will be installed in $HOME/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
# exit on error
set -e
TMUX_VERSION=1.8
@att14
att14 / lambda_tuple.py
Last active December 12, 2015 08:18
Lambda tuple expansion
t = lambda x: (lambda a, b: a * b)(*x)
t((5, 2)) # 10
@NoobsArePeople2
NoobsArePeople2 / gist:5121597
Last active November 10, 2023 14:33
Configure media keys on a non-Apple keyboard to control Spotify via AppleScript and USB Overdrive on OSX.

Requirements

  1. USB Overdrive
  2. A non-Apple keyboard with media keys (or keys you want to make "media" keys). For reference, I'm using a Microsoft Sidewinder X4

Set Up

  1. Plug in your keyboard and install USB Overdrive.
  2. Open USB Overdrive. Click into the Settings tab.
  3. Click the dropdown and select "Any Keyboard, Any Application"
@gfreezy
gfreezy / .slate.js
Last active November 18, 2021 16:13
slate configuration
var pushRight = slate.operation("push", {
"direction": "right",
"style": "bar-resize:screenSizeX/2"
});
var pushLeft = slate.operation("push", {
"direction": "left",
"style": "bar-resize:screenSizeX/2"
});
anonymous
anonymous / -
Created August 14, 2014 18:37
import operator
def generate_decreasing_n_sequence_with_bounded_sum(sequence_length, sum_bound, value_bound=float('inf')):
if sequence_length == 0:
yield []
return
min_remaining = sequence_length*(sequence_length - 1)/2
bound_for_current = min(sum_bound - min_remaining, value_bound)
for value in range(sequence_length, bound_for_current):
anonymous
anonymous / partialable.py
Created September 13, 2014 10:22
import inspect
class n_partialable(object):
@staticmethod
def arity_evaluation_checker(function):
is_class = inspect.isclass(function)
if is_class:
function = function.__init__
@wvengen
wvengen / extend.sh
Last active April 22, 2024 14:02
Extend non-HiDPI external display above HiDPI internal display
#!/bin/sh
# extend non-HiDPI external display on DP* above HiDPI internal display eDP*
# see also https://wiki.archlinux.org/index.php/HiDPI
# you may run into https://bugs.freedesktop.org/show_bug.cgi?id=39949
# https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/883319
EXT=`xrandr --current | sed 's/^\(.*\) connected.*$/\1/p;d' | grep -v ^eDP | head -n 1`
INT=`xrandr --current | sed 's/^\(.*\) connected.*$/\1/p;d' | grep -v ^DP | head -n 1`
ext_w=`xrandr | sed 's/^'"${EXT}"' [^0-9]* \([0-9]\+\)x.*$/\1/p;d'`
anonymous
anonymous / alternate_init.el
Created January 2, 2015 14:31
(package-initialize)
(defun set-my-font-for-frame (frame)
(interactive (list nil))
(set-frame-font "Monaco for Powerline-12" nil t))
;; ;; This is needed because you can't set the font at daemon start-up.
(add-hook 'after-make-frame-functions 'set-my-font-for-frame)
(add-hook 'after-make-frame-functions (lambda (frame) (load-theme 'solarized-dark t)))
anonymous
anonymous / molokai_init.el
Created January 12, 2015 22:49
(setq server-use-tcp t)
(package-initialize)
(load-theme 'molokai t)