Skip to content

Instantly share code, notes, and snippets.

@redinger
redinger / Emacs.md
Created November 26, 2011 03:22
Setting up Emacs daemon on OS X

Setting up Emacs daemon on OS X

Tired of waiting for emacs to start on OS X? This step by step guide will teach you how to install the latest version of emacs and configure it to start in the background (daemon mode) and use emacsclient as your main editor.

Install Cocoa Emacs

Download the latest pretest version of [Emacs for Mac OS X]: http://emacsformacosx.com/builds

@segphault
segphault / huetest.py
Created November 29, 2012 07:26
Adjust brightness of Hue bulb
import json, urllib2
CLIENT_IP = "xxxx"
CLIENT_ID = "xxxx"
def build_url(endpoint):
return "http://{0}/api/{1}/{2}".format(CLIENT_IP, CLIENT_ID, endpoint)
def send(endpoint, value):
url = build_url(endpoint)

Moving from jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@burtlo
burtlo / !result.md
Last active December 29, 2015 06:39

The Problem

I wanted to use a background gradient to represent the types of a Pokémon. There are 18 possible Pokémon types. Pokémon can have one type and some have two types. This leads to roughly 324 combinations (When a Pokémon is one type I simply double that type) or 171 combinations (18 as a triangular number) if I order the types.

The Result

Static Image: Pokemon Types Live: http://attackdex.herokuapp.com/

The Method

@bzg
bzg / emacs-strip.el
Last active January 2, 2023 21:22
Emacs, naked
;; Prevent the cursor from blinking
(blink-cursor-mode 0)
;; Don't use messages that you don't read
(setq initial-scratch-message "")
(setq inhibit-startup-message t)
;; Don't let Emacs hurt your ears
(setq visible-bell t)
;; You need to set `inhibit-startup-echo-area-message' from the
;; customization interface:
@namuol
namuol / INSTALL.md
Last active July 24, 2023 11:53
rage-quit support for bash

rage-quit support for bash

HOW TO INSTALL

Put flip somewhere in your $PATH and chmod a+x it.

Copy fuck into ~/.bashrc.

@groovenectar
groovenectar / roundedcube.scad
Last active October 12, 2024 06:36
roundedcube.scad - Fork me and make me better!
// More information: https://danielupshaw.com/openscad-rounded-corners/
// Set to 0.01 for higher definition curves (renders slower)
$fs = 0.15;
module roundedcube(size = [1, 1, 1], center = false, radius = 0.5, apply_to = "all") {
// If single value, convert to [x, y, z] vector
size = (size[0] == undef) ? [size, size, size] : size;
translate_min = radius;
@siers
siers / nap.rb
Last active April 30, 2017 06:04
a more natural alarm clock command line interface
#!/usr/bin/env ruby
require 'time'
def die(str)
$stderr.puts str
exit
end
def usage
@nikhan
nikhan / twitter.sh
Created January 1, 2016 04:45
twitter ffmpeg
ffmpeg -i test.mov -vcodec libx264 -vf 'scale=640:trunc(ow/a/2)*2' -acodec aac -vb 1024k -minrate 1024k -maxrate 1024k -bufsize 1024k -ar 44100 -strict experimental -r 30 out.mp4
@miohtama
miohtama / sheet.py
Last active July 29, 2022 11:47
Creating and sharing Google Sheet spreadsheets using Python
"""Google spreadsheet related.
Packages required: gspread, cryptography, oauth2client, google-api-python-client
For OSX see
* http://stackoverflow.com/a/33508676/315168
"""
import logging