Skip to content

Instantly share code, notes, and snippets.

;;; anything-gist.el --- anything-sources and some utilities for gist.
;; Filename: auto-complete-acr.el
;; Description: Anything extension for gist
;; Author: myuhe <yuhei.maeda_at_gmail.com>
;; Maintainer: myuhe
;; Copyright (C) 2009, 2010, myuhe , all rights reserved.
;; Created: 2009-04-13
;; Version: 0.6
;; Keywords: convenience, anything, git, gist
@orefalo
orefalo / TemporalModel
Created November 16, 2010 15:26
DB independent and automatic update of create and update date fields - JPA
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.MappedSuperclass;
import javax.persistence.PrePersist;
import javax.persistence.PreUpdate;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import play.db.jpa.Model;
@m1m0r1
m1m0r1 / tweetclass.py
Created July 25, 2011 20:48
Text classification using Twitter, MeCab, TokyoCabinet and nltk.
#!/usr/bin/env python2.6
# coding: utf-8
# Twitter
import twitter
CONSUMER_KEY = ''
CONSUMER_SECRET = ''
ACCESS_TOKEN_KEY = ''
ACCESS_TOKEN_SECRET = ''
@mxcl
mxcl / uninstall_homebrew.sh
Created August 26, 2011 11:25
Uninstall Homebrew
#!/bin/sh
# Just copy and paste the lines below (all at once, it won't work line by line!)
# MAKE SURE YOU ARE HAPPY WITH WHAT IT DOES FIRST! THERE IS NO WARRANTY!
function abort {
echo "$1"
exit 1
}
set -e
@guillaumebort
guillaumebort / test.scala
Created August 31, 2011 19:38
Scalate in Play 1.2.3
package controllers {
import play._
import play.mvc._
object Scalate {
import java.io._
import org.fusesource.scalate._
@terkel
terkel / jquery.placeholder.js
Created September 23, 2011 00:56
HTML5 Placeholder Polyfill using jQuery
(function ($) {
$(function () {
if (!supportsInputAttribute('placeholder')) {
$('[placeholder]').each(function () {
var $this = $(this),
$form = $this.closest('form'),
placeholderText = $this.attr('placeholder'),
placeholderColor = 'GrayText',
defaultColor = $this.css('color');
dispatch_semaphore_t semaphore = dispatch_semaphore_create(1);
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
sleep(1);
dispatch_semaphore_signal(semaphore);
sleep(1);
dispatch_semaphore_signal(semaphore);
sleep(1);
dispatch_semaphore_signal(semaphore);
});
;; インデントの関数の再設定
(add-hook 'js2-mode-hook
#'(lambda ()
(require 'js)
(setq js-indent-level 4
js-expr-indent-offset 4
indent-tabs-mode nil)
(set (make-local-variable 'indent-line-function) 'js-indent-line)))
@masutaka
masutaka / init.el
Created December 16, 2011 17:45
dired-todays-face
(defface dired-todays-face '((t (:foreground "forest green"))) nil)
(defvar dired-todays-face 'dired-todays-face)
(defconst month-name-alist
'(("1" . "Jan") ("2" . "Feb") ("3" . "Mar") ("4" . "Apr")
("5" . "May") ("6" . "Jun") ("7" . "Jul") ("8" . "Aug")
("9" . "Sep") ("10" . "Oct") ("11" . "Nov") ("12" . "Dec")))
(defun dired-today-search (arg)
"Fontlock search function for dired."
@ryseto
ryseto / gist:2259918
Created March 31, 2012 06:19
Font setting for Emacs23 (Cocoa Emacs) create-fontset
;;; フォントセットを作る
(let* ((fontset-name "myfonts") ; フォントセットの名前
(size 12) ; ASCIIフォントのサイズ [9/10/12/14/15/17/19/20/...]
(asciifont "Menlo") ; ASCIIフォント
(jpfont "Hiragino Maru Gothic ProN") ; 日本語フォント
(font (format "%s-%d:weight=normal:slant=normal" asciifont size))
(fontspec (font-spec :family asciifont))
(jp-fontspec (font-spec :family jpfont))
(fsn (create-fontset-from-ascii-font font nil fontset-name)))
(set-fontset-font fsn 'japanese-jisx0213.2004-1 jp-fontspec)