Skip to content

Instantly share code, notes, and snippets.

@atduskgreg
atduskgreg / flickr_downloader.rb
Created January 13, 2013 21:09
Simple Ruby script to download images from a Flickr group.
require 'flickraw'
# get your flickr api key here: http://www.flickr.com/services/apps/create/apply
API_KEY = "PUT YOURS HERE"
SECRET = "PUT YOURS HERE"
ACCESS_TOKEN = "PUT YOURS HERE"
ACCESS_SECRET = "PUT YOURS HERE"
gid = "ID of group to download from" # i.e. "16978849@N00" is the blackandwhite group
(defun copy-comment-paste ()
"copy active region/current line, comment, and then paste"
(interactive)
(unless (use-region-p)
(progn
(beginning-of-line 2)
(push-mark (line-beginning-position 0))))
(kill-ring-save (region-beginning) (region-end))
(comment-region (region-beginning) (region-end))
(yank)
@icholy
icholy / bit_flags.go
Last active December 15, 2015 23:10
Bit flags in Go
package main
// explicite
const (
SAY_NIL = 0x00 // 0b00000000
SAY_HELLO = 0x01 // 0b00000001
SAY_FOO = 0x02 // 0b00000010
SAY_BYE = 0x04 // 0b00000100
)
@sabof
sabof / gist:6329267
Last active December 21, 2015 15:49
Customizing flymake output
(defadvice flymake-post-syntax-check (before coffee-no-spaces activate)
"Warn about space indentation when in coffee-mode."
(when (eq major-mode 'coffee-mode)
(let (bad-spaces)
(save-excursion
(goto-char (point-min))
(while (re-search-forward
"^[[:blank:]]*\\(?1: \\)[[:blank:]]*[^[:blank:]\n]"
nil t)
(let (( ppss (syntax-ppss (match-beginning 1))))
@nicerobot
nicerobot / README.md
Last active January 18, 2016 19:21
pkg-config for gdal to allow go-gdal to build
@DamienCassou
DamienCassou / update-emacs-ppa.sh
Last active February 20, 2016 21:26
Emacs-snapshot and emacs24 build script for Ubuntu PPA
#! /usr/bin/env bash
# Author: Damien Cassou
#
# This is the script I use to build Emacs packages for Ubuntu. These
# packages are uploaded to
# https://launchpad.net/~cassou/+archive/emacs/. Each package is
# either build from a Debian package or from
# http://emacs.naquadah.org/.
@mechanicker
mechanicker / emacsserver.el
Created December 2, 2010 10:01
Emacs client implementation in lisp
;; -*-mode:Emacs-Lisp;buffer-cleanup-p:t-*-
;; Time-stamp: <2010-09-15 08:54:34 dky>
;;-----------------------------------------------------------------------------
;; File : emacsserver.el
;; Auth : Dhruva Krishnamurthy (dhruvakm@gmail.com)
;; Status : Development (flaky)
;; Usage :
;; o As server:
;; (require 'emacsserver)
;; (emacsserver-start "magic")
@BinaryMuse
BinaryMuse / colortest
Created April 1, 2011 22:40
perl based color test for your terminal
#!/usr/bin/perl
# by entheon, do whatever the hell you want with this file
print "\n";
print "**************************\n";
print "*XTERM 256Color Test Chart\n";
print "**************************\n";
print "* 16 = black\n";
print "* 255 = white\n";
# Requires fish 2.2b1 or later for the "abbr" command.
abbr -a ga="git add"
abbr -a gc="git commit"
abbr -a gco="git checkout"
abbr -a gst="git status"
abbr -a gl="git pull"
abbr -a gp="git push"
abbr -a gu="git up"
abbr -a s="git status -sb"
abbr -a l="git log"
@nphyx
nphyx / terminalrc
Last active July 30, 2017 12:49 — forked from jlhg/terminalrc
Zenburn colours scheme for Xfce Terminalhttp://slinky.imukuppi.org/zenburnpage/
# Zenburn colours scheme for Xfce Terminal updated for Xfce4-terminal 0.6.3. Copy and paste the following in ${HOME}/.config/xfce4/Terminal/terminalrc:
ColorBackground=#404040
ColorForeground=#F6F3E8
ColorCursor=#8f8fafaf9f9f
ColorPalette=#3f3f3f3f3f3f;#e8e893939393;#9e9ecece9e9e;#f0f0dfdfafaf;#8c8cd0d0d3d3;#c0c0bebed1d1;#dfdfafaf8f8f;#efefefefefef;#3f3f3f3f3f3f;#e8e893939393;#9e9ecece9e9e;#f0f0dfdfafaf;#8c8cd0d0d3d3;#c0c0bebed1d1;#dfdfafaf8f8f;#efefefefefef