This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
# You can use this script in a pipe. It's input will become an emacs buffer | |
# via emacsclient (so you need server-start etc.) | |
# See http://mark.aufflick.com/o/886457 for more information | |
# Copyright (C) 2011 by Mark Aufflick <mark@aufflick.com> | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// main.m | |
// PerlFeedTest | |
// | |
// Created by Robert Boone on 6/3/11. | |
// Copyright 2011 __MyCompanyName__. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> | |
#import <PubSub/PubSub.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
@interface NSString (NSString_NSJSONSerialization) | |
-(id)toArray; | |
-(id)toDict; | |
@end | |
@implementation NSString (NSString_NSJSONSerialization) | |
-(id)toArray { | |
NSData *jsonData = [self dataUsingEncoding:NSUTF8StringEncoding]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
# Usage: perl opml2org.pl "My OPML File.opml" | |
use XML::Parser; | |
binmode STDOUT, ":utf8"; | |
$xp = new XML::Parser(); | |
$xp->setHandlers(Start => \&start, End => \&end); | |
$xp->parsefile($ARGV[0]); | |
$indent = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[mergetool.ediff] | |
cmd = /opt/emacs24/bin/emacs -q --eval \"(progn (defun ediff-write-merge-buffer () (let ((file ediff-merge-store-file)) (set-buffer ediff-buffer-C) (writ\ | |
e-region (point-min) (point-max) file) (message \\\"Merge buffer saved in: %s\\\" file) (set-buffer-modified-p nil) (sit-for 1))) (setq ediff-quit-hook 'kill\ | |
-emacs ediff-quit-merge-hook 'ediff-write-merge-buffer) (ediff-merge-files-with-ancestor \\\"$LOCAL\\\" \\\"$REMOTE\\\" \\\"$BASE\\\" nil \\\"$MERGED\\\"))\" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(let* ((my-auth '(("localhost:80" ("iOS Pratice" . "cm9iZXJ0OmtvbWJhdA==")))) | |
(url-basic-auth-storage 'my-auth)) | |
(switch-to-buffer (url-retrieve-synchronously "http://localhost/~robert/pratice"))) | |
(defmacro web-auth (&rest body) | |
`(let* ((my-auth '(("localhost:80" ("iOS Pratice" . "cm9iZXJ0OmtvbWJhdA==")))) | |
(url-basic-auth-storage 'my-auth)) | |
,@body)) | |
(macroexpand-all '(web-auth |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Before we talk about Agendas in org-mode I need to add two more | |
things that I forgot to add last time. The first are a few basic | |
global key bindings you should have for org-mode in your .emacs | |
file. | |
1: (global-set-key "\C-cl" 'org-store-link) | |
2: (global-set-key "\C-ca" 'org-agenda) | |
3: (global-set-key "\C-cb" 'org-iswitchb) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; | |
;; NS CHEATSHEET | |
;; | |
;; * :require makes functions available with a namespace prefix. | |
;; | |
;; * :use makes functions available without a namespace prefix | |
;; (i.e., refers functions to the current namespace). | |
;; | |
;; * :import refers Java classes to the current namespace. | |
;; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns fizzbuzz) | |
(defn fizz [n] | |
(if (zero? (mod n 3)) "fizz")) | |
(defn buzz [n] | |
(if (zero? (mod n 5)) "buzz")) | |
(def fb-list [fizz buzz]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defmacro with-directory (dir &rest body) | |
(declare (indent 2)) | |
(let ((hold-dir (gensym))) | |
`(let ((,hold-dir default-directory)) | |
(unwind-protect | |
(progn | |
(cd ,dir) | |
,@body) | |
(cd ,hold-dir))))) |