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
;;; 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
;;
;; cfw:howm-from-calendar-fast
(defun cfw:howm-from-calendar-fast ()
(interactive)
(let* ((mdy (cfw:cursor-to-nearest-date))
(m (calendar-extract-month mdy))
(d (calendar-extract-day mdy))
(y (calendar-extract-year mdy))
(key (format-time-string
howm-date-format
@peccu
peccu / 0.png
Created June 20, 2011 03:32 — forked from hitode909/0.png
Emacsがブロックしたらポップアップを出す
0.png
@peccu
peccu / pattern_file.json
Created November 16, 2011 14:37 — forked from toshia/pattern_file.json
写真アップロードサービスのURLから画像のURLを得るためのマッチ条件
{
"twitpic": {
"url": "^http://twitpic\\.com/[a-zA-Z0-9]+",
"attribute": {
"id": "photo-display"
}
},
"yfrog": {
"url": "^http://yfrog\\.com/[a-zA-Z0-9]+",
"attribute": {
@peccu
peccu / pattern_file.json
Created December 7, 2011 10:16 — forked from toshia/pattern_file.json
写真アップロードサービスのURLから画像のURLを得るためのマッチ条件
{
"twitpic": {
"url": "^http://twitpic\\.com/[a-zA-Z0-9]+",
"attribute": {
"id": "photo-display"
}
},
"yfrog": {
"url": "^http://yfrog\\.com/[a-zA-Z0-9]+",
"attribute": {
@peccu
peccu / dict.m
Created January 6, 2012 07:42 — forked from hitode909/dict.py
非同期に辞書を引く
// copy from https://gist.github.com/1203094
// gcc -o dict -Wall -fobjc-gc -O2 -std=c99 dict.m -framework carbon -framework cocoa
#import <Cocoa/Cocoa.h>
#import <CoreServices/CoreServices.h>
int main(int argc, char *argv[])
{
NSString *word;
NSString *result;
@peccu
peccu / anything-org-mode.el
Created January 11, 2012 17:57
anything-org-mode.el
(defun anything-org-todo-list (arg)
(interactive "P")
(org-compile-prefix-format 'todo)
(org-set-sorting-strategy 'todo)
;;(org-prepare-agenda "TODO")
(if (and (stringp arg) (not (string-match "\\S-" arg))) (setq arg nil))
(let* ((today (time-to-days (current-time)))
(date (calendar-gregorian-from-absolute today))
(kwds org-todo-keywords-for-agenda)
(completion-ignore-case t)
@peccu
peccu / common.css
Created May 20, 2012 04:43 — forked from takumikinjo/.gitignore
HTML5 Presentation export for Org-mode
#speaker-note {
position:absolute;
left: 0;
top: 80%;
width: 100%;
height: 20%;
z-index: 8;
opacity: 0.75;
background-color: white;
overflow: auto;
;; This function is quoted from this page. Thanks to Tomohiro Matsuyama.
;; http://dev.ariel-networks.com/Members/matsuyama/pretty-lambda-in-emacs/
(defun set-pretty-patterns (patterns)
(loop for (glyph . pairs) in patterns do
(loop for (regexp . major-modes) in pairs do
(loop for major-mode in major-modes do
(let ((major-mode (intern (concat (symbol-name major-mode) "-mode")))
(n (if (string-match "\\\\([^?]" regexp) 1 0)))
(font-lock-add-keywords major-mode
`((,regexp (0 (prog1 ()
@peccu
peccu / ng-really.js
Last active February 11, 2018 13:42 — forked from asafge/ng-really.js
/**
* A generic confirmation for risky actions.
* Usage: Add attributes: ng-really-message="Are you sure?" ng-really-click="takeAction()" ng-really-cancel-click="cancelAction()" function
*/
angular.module('app').directive('ngReallyClick', [function() {
return {
restrict: 'A',
link: function(scope, element, attrs) {
element.bind('click', function() {
var message = attrs.ngReallyMessage;