Skip to content

Instantly share code, notes, and snippets.

@ieure
ieure / python-pylint.el
Created February 12, 2010 18:49
Run pylint on Python source in Emacs.
;;; python-pylint.el --- minor mode for running `pylint'
;; Copyright (c) 2009, 2010 Ian Eure <ian.eure@gmail.com>
;; Author: Ian Eure <ian.eure@gmail.com>
;; Keywords: languages python
;; Last edit: 2010-02-12
;; Version: 1.01
@klipstein
klipstein / b64field.py
Created November 22, 2010 12:25
Base64 file handling for django-tastypie
import base64
import os
from tastypie.fields import FileField
from django.core.files.uploadedfile import SimpleUploadedFile
class Base64FileField(FileField):
"""
A django-tastypie field for handling file-uploads through raw post data.
It uses base64 for en-/decoding the contents of the file.
Usage:
@hyone
hyone / gist:1323137
Created October 28, 2011 19:04
evil-text-object-defun
(require 'evil)
(setq evil-move-defun-alist
'((ruby-mode . (ruby-beginning-of-defun . ruby-end-of-defun))
(c-mode . (c-beginning-of-defun . c-end-of-defun))
(js2-mode . (js2-beginning-of-defun . js2-end-of-defun))))
(defun evil-move-defun (count &optional begin-defun end-defun)
"Move by defun"
(let ((count (or count 1))
@cefstat
cefstat / lion-fullscreen.patch
Created November 10, 2011 19:31
Patch for Emacs fullscreen support under Mac OS X 10.7 (Lion)
=== modified file 'lisp/term/ns-win.el'
--- old/lisp/term/ns-win.el 2011-10-01 20:32:01 +0000
+++ new/lisp/term/ns-win.el 2011-11-10 16:22:51 +0000
@@ -928,6 +928,10 @@
(add-to-list 'frame-creation-function-alist '(ns . x-create-frame-with-faces))
(add-to-list 'window-system-initialization-alist '(ns . ns-initialize-window-system))
+(declare-function ns-toggle-fullscreen-internal "nsfns.m" ())
+(defun ns-toggle-fullscreen ()
+ (interactive)
@jlongster
jlongster / gist:1712455
Created January 31, 2012 19:37
traditional lisp macros
;; outlet code for implementing traditional macro expansion
;; macros
(define (expand form)
(cond
((variable? form) form)
((literal? form) form)
((macro? (car form))
(expand ((macro-function (car form)) form)))
@death
death / gist:2316075
Created April 6, 2012 02:22
DCPU-16 Lisp implementation
(defpackage #:dcpu-16
(:use #:cl)
(:export
#:make-ram #:ram-read #:ram-write #:ram-size
#:execute #:debug
#:load-program #:assemble-program
#:set #:add #:sub #:mul
#:div #:mod #:shl #:shr
#:and #:bor #:xor #:ife
#:ifn #:ifg #:ifb #:jsr
@sshirokov
sshirokov / fsm.lisp
Created May 14, 2012 23:51
CLOS FSM with MOP Sauce (requires :closer-mop)
(defpackage :fsm
(:use :cl)
(:export :standard-state-machine
:standard-state-machine-event
:state
:defstate
:deffsm))
(in-package :fsm)
;; Basic copy-pasta protection
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 23, 2024 18:01
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@mogigoma
mogigoma / elnode-publish.el
Created August 11, 2012 06:25
A hack to publish any buffer exactly as it appears in Emacs on demand over HTTP.
(defvar mak/elnode-publish-port
4444
"The port for published buffers to be served on.")
(defvar mak/elnode-publish-buffers
(make-hash-table :test 'equal)
"List of the buffers to publish over HTTP.")
(defun mak/elnode-publish-handler (httpcon)
"Handler for buffers published by Elnode."
@FredEckert
FredEckert / framebuffer.c
Created August 22, 2012 13:15
Paint Pixels to Screen via Linux FrameBuffer
/*
To test that the Linux framebuffer is set up correctly, and that the device permissions
are correct, use the program below which opens the frame buffer and draws a gradient-
filled red square:
retrieved from:
Testing the Linux Framebuffer for Qtopia Core (qt4-x11-4.2.2)
http://cep.xor.aps.anl.gov/software/qt4-x11-4.2.2/qtopiacore-testingframebuffer.html
*/