Skip to content

Instantly share code, notes, and snippets.

//
// FlickDynamics.h
// (c) 2009 Dave Peck <davepeck [at] davepeck [dot] org>
// http://davepeck.org/
//
// This code is released under the BSD license. If you use my code in your product,
// please put my name somewhere in the credits and let me know about it!
//
// This code mimics the scroll/flick dynamics of the iPhone UIScrollView.
// What's cool about this code is that it is entirely independent of any iPhone
static NSString * const AQPerThreadManagedObjectContext = @"AQPerThreadManagedObjectContext";
void StoreManagedObjectContextForCurrentThread( NSManagedObjectContext * context )
{
[[[NSThread currentThread] threadDictionary] setObject: context forKey: AQPerThreadManagedObjectContext];
}
NSManagedObjectContext * PerThreadManagedObjectContext( void )
{
NSManagedObjectContext * result = [[[NSThread currentThread] threadDictionary] objectForKey: AQPerThreadManagedObjectContext];
uniform float uValue; // Value/brighness component.
const float kPi = 3.141592653589793;
vec3 hsv2rgb(float h, float s, float v)
{
float hi = h * 3.0 / kPi; // Sector, [-3..3)
float f = hi - floor(hi); // Fractional part.
(autoload 'wl "wl" "Wanderlust" t)
(autoload 'wl-other-frame "wl" "Wanderlust on new frame." t)
(autoload 'wl-draft "wl-draft" "Write draft with Wanderlust." t)
(add-hook 'wl-init-hook 'ecb-deactivate) ;;ecb messes things up for me
(add-hook 'wl-exit-hook 'ecb-activate)
(require 'mime-w3m)
(setq ssl-certificate-verification-policy 1)
@baron
baron / new
Created October 14, 2010 11:14
#
# Folder definition file
# This file is generated automatically by Wanderlust/2.15.5 (Almost Unreal).
#
# If you edit this file by hand, be sure that comment lines
# will be washed out by wl-fldmgr.
#
diff --git a/twittering-mode.el b/twittering-mode.el
index 3a34794..143599c 100644
--- a/twittering-mode.el
+++ b/twittering-mode.el
@@ -428,6 +428,7 @@ StatusNet Service.")
(mentions . "statuses/mentions")
(public . "statuses/public_timeline")
(replies . "statuses/replies")
+ (favorites . "favorites")
(retweeted_by_me . "statuses/retweeted_by_me")
diff --git a/switch-window.el b/switch-window.el
index 1f63598..d2c7b3c 100644
--- a/switch-window.el
+++ b/switch-window.el
@@ -95,7 +95,8 @@ from-current-window is not nil"
(lines-before (/ increased-lines 2))
(margin-left (/ w h) ))
;; increase to maximum switch-window-increase
- (text-scale-increase scale)
+ (when (> emacs-major-version 22)
@baron
baron / gist:672151
Created November 11, 2010 07:21
e22 sw hack
diff --git a/switch-window.el b/switch-window.el
index 444ea6f..b223ddd 100644
--- a/switch-window.el
+++ b/switch-window.el
@@ -100,7 +100,9 @@ from-current-window is not nil"
;; make it so that the huge number appears centered
(dotimes (i lines-before) (insert "\n"))
(dotimes (i margin-left) (insert " "))
- (insert label)))
+ (if (fboundp 'text-scale-increase)
;;;_ , my-remove-duplicates
; This little fellow is great. It removes duplicates from region i.e.
; transforms "foo baz foo bar baz" into "foo baz bar".
(defun my-remove-duplicates (start end)
(interactive "r")
(save-excursion
(goto-char start)
(narrow-to-region start end)
;; 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.5