Skip to content

Instantly share code, notes, and snippets.

from gist
@koseki
koseki / Gemfile
Last active December 21, 2015 05:29
source 'https://rubygems.org'
gem 'berkshelf'
gem 'knife-solo', '~> 0.3.0.pre5'
@koseki
koseki / parse_date.js
Last active December 20, 2015 07:28
JavaScript Simple Date Parse
// http://stackoverflow.com/questions/2587345/javascript-date-parse
function parseDate(input) {
var parts = input.split(/[-:\sTZ\+]/);
return new Date(parts[0], parts[1] - 1, parts[2], parts[3] || 0, parts[4] || 0, parts[5] || 0);
}
/*
Example:
See http://jsfiddle.net/koseki/CEy3g/
@koseki
koseki / index.html
Created July 26, 2013 00:28
Angular JS - copy template
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>AngularJS - copy template</title>
</head>
<body data-ng-app="App" data-ng-controller="AppCtrl">
@koseki
koseki / index.html
Created July 23, 2013 02:29
AngularJS - bind HTML sample / $compile, $timeout(function() {})
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>AngularJS - bind HTML</title>
</head>
<body data-ng-app="SampleApp" data-ng-controller="SampleCtrl">
@koseki
koseki / index.html
Last active December 20, 2015 00:49
AngularJS under the subdirectories. /foo/bar/index.html
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>AngularJS under the subdirectories (app root = /foo/bar/)</title>
<!-- last '/' is required. '/foo/bar' does not work. -->
<base href="/foo/bar/">
@koseki
koseki / wp-plugins.sh
Last active December 19, 2015 21:28
Install WordPress plugins.
#! /bin/sh
#
# http://wordpress.org/plugins/
#
# cd wp-content/plugins
# ./wp-plugins wp-multibyte-patch json-api contact-form-7
#
if [ x"$1" = x ]; then
@koseki
koseki / wp-lang.sh
Last active July 6, 2023 11:31
Download Wordpress translation files. Execute inside the wp-content/languages directory.
#! /bin/sh
#
# Download Wordpress translation files.
# Execute inside the wp-content/languages directory.
#
# http://codex.wordpress.org/Installing_WordPress_in_Your_Language
# http://ja.wordpress.org/install-ja/ (ja)
#
VERSION=3.5.x
@koseki
koseki / install.sh
Last active December 19, 2015 04:18
ngx_small_light trial for debian
#! /bin/sh
# ngx_small_light trial for debian
# with:
# ami-9e1ab19f Debian Squeeze 32bit m1.small
# ami-a601aaa7 Debian Squeeze 64bit m1.small
#
# # cd /root
# # curl https://gist.github.com/koseki/5895824/raw/install.sh | sh
@koseki
koseki / Test.java
Last active December 16, 2015 00:30
libyaml (YAML 1.1) can't parse Block Scalar with no indent.
// SnakeYAML(based on libyaml) http://code.google.com/p/snakeyaml/
// YAML 1.1
// javac -classpath snakeyaml-1.12.jar:. Test.java
// java -classpath snakeyaml-1.12.jar:. Test
import org.yaml.snakeyaml.*;
import java.io.*;
public class Test {
public static void main(String[] args) {