Skip to content

Instantly share code, notes, and snippets.

View hekt's full-sized avatar
🗼

Kazutoshi Horie hekt

🗼
View GitHub Profile
@hekt
hekt / loader.js
Created April 4, 2014 13:13
JavaScript Loader
function jsLoader() {
"use strict";
var scripts = [].slice.call(arguments);
var reserves = [];
var thisScript = document.scripts[0] || document.querySelector("script");
var head = thisScript.parentNode;
if ("async" in thisScript)
parallel();
@hekt
hekt / LotteryEntry.swift
Created November 2, 2014 13:43
lottery プロジェクト の Swift 版 (『MAC OS X COCOA プログラミング』3,4章)
import Foundation
class LotteryEntry: NSObject {
var entryDate: NSDate
var firstNumber: Int
var secondNumber: Int
init(initWithEntryDate theDate: NSDate) {
entryDate = theDate
firstNumber = random() % 100 + 1
@hekt
hekt / SpeakLineAppDelegate.swift
Created November 3, 2014 05:08
SpeakLine アプリケーションの Swift 版 (『MAC OS X COCOA プログラミング』第5章)
import Cocoa
@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate {
@IBOutlet weak var window: NSWindow!
@IBOutlet weak var textField: NSTextField!
let speechSynth = NSSpeechSynthesizer(voice: nil)
@hekt
hekt / LetterCountChallengeAppDelegate.swift
Created November 3, 2014 10:10
LetterCountChallenge アプリケーションの Swift 版 (『MAC OS X COCOA プログラミング』第5章)
import Cocoa
@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate {
@IBOutlet weak var window: NSWindow!
@IBOutlet weak var textField: NSTextField!
@IBOutlet weak var textLabel: NSTextField!
@hekt
hekt / gist:1755965
Created February 6, 2012 23:47
remove too many args from google search url
(function() {
url = location.href;
window.prompt('Clean URL', url.match(/^.+?\?/) + url.match(/q=.*?(?=&)/));
})();
// javascript:(function(){var%20u=location.href;window.prompt('Clean%20URL',u.match(/^.+?\?/)+u.match(/q=.*?(?=&)/))})();
@hekt
hekt / gist:1755984
Created February 6, 2012 23:51
zip individual files/folders
#! /bin/bash
for f in "$@"
do
cd "${f%/*}"
zip -r "${f##*/}" "${f##*/}"
done
@hekt
hekt / tweet_button.css
Created February 23, 2012 10:49
pure css tweet button
/*
* Pure CSS Tweet Button
*/
#tweet_button span {
display: inline-block;
}
#tweet_button .wrap {
position: relative;
font-family: "Arial", sans-serif;
@hekt
hekt / md-result-styling.el
Created March 5, 2012 07:54
emacs keyboard macro for styling markdown html
;; <!-- elem attr="val" -->
;;
;; <elem>
;; => <elem attr="val">
;; <!-- section -->, <!-- /section -->
;; => <section>, </section>
;; <pre[ attr="val"]><code>, </code></pre>
;; => <pre[ attr="val"]>, </pre>
@hekt
hekt / gist:3015451
Created June 29, 2012 03:12
Google Personal Blocklist
b.hatena.ne.jp
clip.livedoor.com
ceron.jp
www.kira-ku.com
kuapi.fresheye.com
live.gummy.jp
keyword.gotowebdb.com
b.arw.cc
bookmarks.yahoo.co.jp
jobtalk.jp
@hekt
hekt / gist:3727949
Created September 15, 2012 13:39
YouTube Large player by default
/*
http://blog.hawn.be/2011/10/07/how-to-force-youtube-to-use-expanded-view-by-default-and-even-larger/
*/
div#watch-player.flash-player,
div#watch-player.html5-player,
div#watch-video {
width: 854px !important; height: 510px !important;
/* width: 970px !important; height: 580px !important; */
/* width: 1280px !important; height: 765px !important; */