Skip to content

Instantly share code, notes, and snippets.

View peccu's full-sized avatar
🦉
Information is the network

peccu peccu

🦉
Information is the network
View GitHub Profile
#!/usr/bin/env perl
use strict;
use warnings;
use FindBin;
use Text::MicroTemplate::File;
my $info = qx{/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -I};
my ($ssid) = $info =~ / SSID: (.*)$/m;
@takumikinjo
takumikinjo / .gitignore
Created August 5, 2010 13:56
HTML5 Presentation export for Org-mode
README.html
@kawaguchi
kawaguchi / arity-example.el
Created October 5, 2010 12:36
引数の数を調べる
(arity (symbol-function 'identity)) ;=> (1 . 1)
(arity (symbol-function '+)) ;=> (0 . many)
(arity (symbol-function 'substring)) ;=> (2 . 3)
(defun foo (a b c &optional d e f))
(arity (symbol-function 'foo)) ;=> (3 . 6)
(defun bar (a b c &rest rest))
(arity (symbol-function 'bar)) ;=> (3 . many)
@hitode909
hitode909 / jpg2html.rb
Created November 21, 2010 08:32
kindlegen用のhtmlを作る
#!/usr/bin/env ruby
require 'optparse'
def tag(name, attr = nil, content = nil)
unless attr or content
return "<#{name}>"
end
if not attr and content
return "<#{name}>#{content}</#{name}>"
@hitode909
hitode909 / trimming_for_kindle.rb
Created November 21, 2010 08:45
画像をKindle用にトリミング,リサイズ,ガンマ調整
#!/usr/bin/env ruby
def suffix(file, suffix)
base = File.basename(file, File.extname(file))
ext = File.extname(file)
"#{base}#{suffix}#{ext}"
end
banner = <<EOF
usage
@wasabili
wasabili / Lisp.py
Created November 21, 2010 10:02
Lisp Interpreter
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys, traceback, re
from fractions import Fraction
nil = type('Nil', (), {'__str__': lambda self: '()'})()
undef = type('Undef', (), {'__str__': lambda self: '#<undef>'})()
f = type('F', (), {'__str__': lambda self: '#f'})()

gistでorg-modeが使えるか、テスト

普通に使えるみたいねー

表も使える

hogefugahage
eggspamham
foobarbaz
@yaotti
yaotti / anything-mac-itunes.el
Created December 2, 2010 13:17
Anything interface for iTunes (Mac only)
;;; anything-mac-itunes.el --- Use iTunes on Mac with anything.el
;; Copyright (C) 2010 Hiroshige Umino
;; Author: Hiroshige Umino <yaotti@gmail.com>
;; Created: 2010-11-24
;; Version: 0.0.1
;;
;; Keywords: anything, mac
;;

(a gist based on the old toolmantim article on setting up remote repos)

To collaborate in a distributed development process you’ll need to push code to remotely accessible repositories.

This is somewhat of a follow-up to the previous article setting up a new rails app with git.

For the impatient

Set up the new bare repo on the server:

@rummelonp
rummelonp / Account.m
Created January 26, 2011 13:58
Objective-Cでマルチアカウント対応するためのモデル
#import <Foundation/Foundation.h>
@interface Account : NSObject
{
NSString* uuid;
NSString* email;
NSString* password;
}
@property (readonly) NSString* uuid;