Skip to content

Instantly share code, notes, and snippets.

View jasonm23's full-sized avatar

Jason Milkins jasonm23

View GitHub Profile
@jasonm23
jasonm23 / gist:445617
Created June 20, 2010 06:41
Stage 1 library database for fluxus...
INSERT INTO "libraries" ("id","name","package","repository","created_at","updated_at","license","host","description","homepage","docs","tags","creator","summary","sourcepath") VALUES(1,'Papervision P3D','svn','http://papervision3d.googlecode.com/svn/trunk/','2010-05-19 12:49:48','2010-06-19 00:25:54','MIT licence','http://code.google.com',' ![](http://pv3d.org/Papervision3DLogo.png)
Getting started and other questions: [http://forum.papervision3d.org](http://forum.papervision3d.org)
','http://papervision3d.googlecode.com/','http://papervision3d.googlecode.com/svn/trunk/as3/trunk/docs/index.html','3d, graphics','','Papervision3D is an open source 3D engine for the Flash platform','');
INSERT INTO "libraries" ("id","name","package","repository","created_at","updated_at","license","host","description","homepage","docs","tags","creator","summary","sourcepath") VALUES(2,'SiON','svn','http://www.libspark.org/svn/as3/SiOPM/trunk/','2010-05-19 12:51:30','2010-06-05 13:19:03','custom open source - attribution','
@jasonm23
jasonm23 / WindowBlur.as
Created June 20, 2010 08:45
this is a code hosting stop gap for WindowBlur by Devon O Wolfgang.
package onebyone {
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.display.DisplayObjectContainer;
import flash.display.Sprite;
import flash.events.Event;
import flash.filters.BlurFilter;
import flash.geom.Point;
import flash.geom.Rectangle;
(defconst client-process-name "*client*")
(defsubst client-process () (get-process client-process-name))
(defun chomp (str)
(if (and (stringp str) (string-match "\r?\n$" str))
(replace-match "" t nil str)
str))
(defun client-notify-connect (&rest args)
(message (format "Connection message [%s]" (mapcar #'chomp args))))

Quick guide to Emacs copy paste...

Select a region?

Begin the region at the cursor C-SPACE then move the cursor around how you like, cursor keys, fwd-back word/line/sentence etc...

Cut (kill) the region?

C-w kills the selected region and puts it in the clipboard (kill-ring)

@jasonm23
jasonm23 / movetext.el
Created July 21, 2010 03:03
Move text (region or current line) up and down
;; Move text (region or current line) up and down through a document. Reminiscent of
;; Eclipse Alt+up/down or NetBeans Alt+S+up/down.
(defun move-text-internal (arg)
(cond
((and mark-active transient-mark-mode)
(if (> (point) (mark))
(exchange-point-and-mark))
(let ((column (current-column))
(text (delete-and-extract-region (point) (mark))))
@jasonm23
jasonm23 / markdown_in_sinatra.mkdn
Created July 23, 2010 00:39
How to do markdown/textile views via erubis in Sinatra.

How to do markdown/textile views via erubis in Sinatra.

require 'bluecloth' # could do the same with RDiscount or Maruku or RedCloth (using Textile instead) or ... whatever.

get '/' do
    BlueCloth.new(erubis :index).to_html
end

and your views/index.erubis would be something like...

;; gist.el --- Emacs integration for gist.github.com
;; Author: Christian Neukirchen <purl.org/net/chneukirchen>
;; Maintainer: Chris Wanstrath <chris@ozmm.org>
;; Contributors:
;; Will Farrington <wcfarrington@gmail.com>
;; Michael Ivey
;; Phil Hagelberg
;; Dan McKinley
;; Version: 0.4
@jasonm23
jasonm23 / supamilky.zsh-theme
Created August 1, 2010 21:59
oh-my-zsh theme 'supamilky'
PROMPT='$fg_bold[cyan][$fg[white]%t$fg_bold[cyan] ]$fg_bold[cyan] [$fg[white]%n@%m$fg_bold[cyan]]
[$fg[white]%~$(git_prompt_info)$fg[white]$(rvm_prompt_info)$fg_bold[cyan]]$reset_color
$ '
# git theming
ZSH_THEME_GIT_PROMPT_PREFIX=" $fg_bold[red]($fg_bold[white]"
ZSH_THEME_GIT_PROMPT_SUFFIX="$fg_bold[red])"
ZSH_THEME_GIT_PROMPT_CLEAN=""
ZSH_THEME_GIT_PROMPT_DIRTY="$fg_bold[cyan]*"
@jasonm23
jasonm23 / dropins.el
Created August 6, 2010 15:41
dropins.el a simple way to load a collection of elisp libraries
;; Dropins
;; This extension provides a simple way to load a set of libraries
;; by placing them in a named folder. This is similar to the site-lisp
;; folder in the Emacs directory, however, Dropins defaults to a folder
;; within the user HONE.
;;
(defgroup dropins nil
"Library dropin folder"
:group 'convenience
@jasonm23
jasonm23 / darkroom-mode.el
Created August 6, 2010 15:42
darkroom-mode.el - fork
;;; darkroom-mode.el - Distraction free editing mode
;; Author: Martin Svenson
;; Usage: M-x darkroom-mode
;; License: free for all usages/modifications/distributions/whatever.
;; Requirements: w32-fullscreen.el or something similar under *nix
(require 'cl)
(require 'w32-fullscreen)