Skip to content

Instantly share code, notes, and snippets.

View hyamamoto's full-sized avatar

Hiroshi Yamamoto hyamamoto

View GitHub Profile
@mxriverlynn
mxriverlynn / 1.js
Created March 29, 2012 03:32
template cache
TemplateCache = {
get: function(selector){
if (!this.templates){ this.templates = {}; }
var template = this.templates[selector];
if (!template){
var template = $(selector).html();
this.templates[selector] = template;
}
@martinsik
martinsik / webgl-demo.dart
Last active November 7, 2020 18:24
Dart + WebGL. For more information visit http://martinsikora.com/dart-webgl-simple-demo
import 'dart:html';
/**
* WebGL Demo made in Dart.
* Updated: March 11th 2013 - Dart SDK 0.4.1
* This example is heavily inspired by:
* http://www.netmagazine.com/tutorials/get-started-webgl-draw-square
*/
class WebGLTest {
@miyukki
miyukki / ZeroFix.user.js
Created May 2, 2012 08:48
ZeroFix is ZeroWatch of niconico fixer. ZeroWatchが改良するまでの暫定的なユーザースクリプトです。 タイトルの縮小、タグの複数段表示、市場エリアを投稿者情報に、コメント入力エリアを下に、フェードを無効化などの機能があります。
// ==UserScript==
// @name ZeroFix
// @namespace applest.net
// @version 0.9
// @description ZeroFix is ZeroWatch of niconico fixer. ZeroWatchが改良するまでの暫定的なユーザースクリプトです。 タイトルの縮小、タグの複数段表示、市場エリアを投稿者情報に、コメント入力エリアを下に、フェードを無効化などの機能があります。
// @include http://www.nicovideo.jp/watch/*
// @license MIT License(http://en.wikipedia.org/wiki/MIT_License)
// ==/UserScript==
/*********************************************
@cameronmcefee
cameronmcefee / gist:2641743
Created May 9, 2012 04:14
Font Configuration File
# Font Squirrel Font-face Generator Configuration File
# Upload this file to the generator to recreate the settings
# you used to create these fonts.
{"mode":"expert","formats":["ttf","woff","eot","svg"],"tt_instructor":"default","options_subset":"advanced","subset_custom":"","subset_custom_range":"f000-f073,f200-f273","filename_suffix":"-webfont","emsquare":"2048","spacing_adjustment":"0","rememberme":"Y"}
@KirinDave
KirinDave / popquiz.clj
Created June 19, 2012 18:22
Pop quiz, spot the clojure bug
(defn normalize-json-args [map]
(letfn [(keyify [s] (keyword (string/replace s "_" "-")))
(cleaner [[k v]] (if (string? k) [(keyify k) v] [k v]))
(walker [x] (if (map? x) (into {} (map cleaner x)) x))]
(postwalk walker map)))
diff -r d2213960ade2 src/cmd/5l/asm.c
--- a/src/cmd/5l/asm.c Sat Jul 14 15:59:52 2012 +0400
+++ b/src/cmd/5l/asm.c Sun Jul 15 19:45:39 2012 +1000
@@ -33,6 +33,7 @@
#include "l.h"
#include "../ld/lib.h"
#include "../ld/elf.h"
+#include "../ld/dwarf.h"
static Prog *PP;
@robbielynch
robbielynch / CaesarCipher.java
Created July 23, 2012 13:53
Caesar Cipher - I made this caesar cipher decrypter to solve hackerrank.com puzzles.
import java.util.Scanner;
public class CaesarCipher {
private static char []letters =
{ 'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'
,'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'
,'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'
};
@iros
iros / API.md
Created August 22, 2012 14:42
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

@nikcub
nikcub / README.md
Created October 4, 2012 13:06
Facebook PHP Source Code from August 2007
@preshing
preshing / sort1mb.cpp
Created October 25, 2012 11:28
Sort one million 8-digit numbers in 1MB RAM
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
typedef unsigned int u32;
typedef unsigned long long u64;
//-------------------------------------------------------------------------
// WorkArea
//-------------------------------------------------------------------------