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
@btmills
btmills / ufgets.c
Last active December 13, 2022 01:44
Unlimited fgets() - read input from the console with automatic buffer sizing.
#include <stdio.h>
#include <stdlib.h>
/*
* Similar to fgets(), but handles automatic reallocation of the buffer.
* Only parameter is the input stream.
* Return value is a string. Don't forget to free it.
*/
char* ufgets(FILE* stream)
{
@discolingua
discolingua / processing-mode.el
Created November 16, 2012 02:15
Processing-mode for emacs and Processing 2.0
;; processing-mode.el
;; Processing.org language based on Java mode. Adds keyword
;; highlighting for all recognized Processing language functions.
;; Allows compilation of buffers and "sketches" from within Emacs but
;; only for more recent versions of Processing.
;; Copyright (C) 2008, 2009 Rudolf Olah <[email protected]>
;; Modified for Processing 2.0 by Bunny Blake <[email protected]>
@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">
@alexott
alexott / minimial-cedet-config.el
Created October 22, 2012 07:30
Working configuration for CEDET from bzr & GNU Emacs (with working C++ & Java name completion)
;;; minimial-cedet-config.el --- Working configuration for CEDET from bzr
;; Copyright (C) Alex Ott
;;
;; Author: Alex Ott <[email protected]>
;; Keywords: cedet, C++, Java
;; Requirements: CEDET from bzr (http://cedet.sourceforge.net/bzr-repo.shtml)
;; Do checkout of fresh CEDET, and use this config (don't forget to change path below)
@areina
areina / emacs-email-setup.md
Created October 12, 2012 15:00
Manage your email in emacs with mu4e

Manage your gmail account in emacs with mu4e

There're a lot of combinations to manage your email with emacs, but this works for me. I've a backup and I can manage my daily email.

The stack:

  • emacs
  • offlineimap
  • mu
  • mu4e
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@k-bx
k-bx / sublime-text-2.el
Created June 10, 2012 22:02
sublime text 2 like theme for emacs
(defun sublime-text-2 ()
(interactive)
(color-theme-install
'(sublime-text-2
((background-color . "#171717")
(background-mode . light)
(border-color . "#1a1a1a")
(cursor-color . "#fce94f")
(foreground-color . "#cfbfad")
(mouse-color . "black"))
@christianparpart
christianparpart / monkeypatchor.cpp
Created May 24, 2012 18:06
Monkey-Patching in C/C++ :-)
// compile me: g++ -shared -fPIC -ldl -o monkeypatchor.so monkeypatchor.cpp
// use me: LD_PRELOAD=`pwd`/monkeypatchor.so /bin/ls
#include <dlfcn.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/mman.h>
void* (*malloc_super)(size_t);
void (*free_super)(void*);
@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>