Skip to content

Instantly share code, notes, and snippets.

View taichi's full-sized avatar
😸
shaving...

taichi taichi

😸
shaving...
View GitHub Profile
import java.io.StringReader
import scala.util.parsing.combinator._
import scala.util.parsing.input._
import scala.util.parsing.combinator.syntactical._
import java.util.Properties
object JSONLikeProperties {
object Parser extends StandardTokenParsers {
lexical.delimiters ++= List("{", "}", "=")
//lexical.reserved ++= List("{", "}", "=")
@barrettclark
barrettclark / Rakefile
Created January 7, 2011 17:44
Example file download rake task
require 'rake'
# http://ruby-doc.org/stdlib/libdoc/net/http/rdoc/classes/Net/HTTP.html
require 'net/http'
desc "this is a test"
task :testing_rake do
puts "Hello from rake!"
end
namespace :remote_file do
@sugyan
sugyan / fizzbuzz.pl
Last active September 21, 2023 08:49
"^ "
=~ (
("(").("~"^"."^"^"^(""=="")."").("^"
^"="^(""=="").""^")").("^"^".").("="
^"~"^(""=="")."").("("^(""=="^").""^
"."^"^").("("^(""=="").""^"^"^")").(
(" ^( "
== "
") .
"" ^
module BinaryTreeZipper
type BinaryTree<'value> =
| Node of BinaryTree<'value> * 'value * BinaryTree<'value> // leftChild * value * rightChild
| LeftOnlyNode of BinaryTree<'value> * 'value
| RightOnlyNode of 'value * BinaryTree<'value>
| Leaf of string
type Path<'value> =
| Top
@taichi
taichi / junit4_template.xml
Last active September 24, 2015 23:48
Junit4 template for eclipse4.5
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<templates>
<template autoinsert="true" context="java-statements" deleted="false"
description="assertEquals - JUnit 4" enabled="true" name="ase">${:importStatic(org.junit.Assert.assertEquals)}assertEquals(${expected:var(java.lang.Object)},
${actual:var(java.lang.Object)});${cursor}</template>
<template autoinsert="true" context="java-statements" deleted="false"
description="assertTrue - JUnit 4" enabled="true" name="astrue">${:importStatic(org.junit.Assert.assertTrue)}assertTrue(${actual:var(boolean)});${cursor}
</template>
<template autoinsert="true" context="java-statements" deleted="false"
description="assertFalse - JUnit 4" enabled="true" name="asfalse">${:importStatic(org.junit.Assert.assertFalse)}assertFalse(${expected:var(boolean)});${cursor}
@seyan
seyan / RegexpSample.java
Created March 24, 2011 05:03
正規表現による入力値検証
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class RegexpSample {
/** 英数字の1文字以上5文字以下 */
private static final String REGEX = "[0-9a-z]{1,5}";
/**
* 正規表現を満たすかどうかの判定メソッド
@torazuka
torazuka / modsg.sh
Created October 9, 2011 05:14
AWS security groupで、自IPアドレスからの22番、80番ポート接続のみ許可する。要ec2-tools
#!/bin/sh
# Before running this script,
# you must install the Java and the ec2-tools,
# and set env of JAVA_HOME, EC2_HOME and PATH.
Usage(){
cat <<- EOF 1>&2
-----------------------------------------------
setting Grobal IP address on AWS Security Group
/**
*
*/
package org.yoshiori.logback.filter;
import org.slf4j.Marker;
import org.slf4j.MarkerFactory;
import ch.qos.logback.classic.spi.ILoggingEvent;
import ch.qos.logback.core.filter.AbstractMatcherFilter;
@draftcode
draftcode / gist:1357281
Created November 11, 2011 05:35
構文解析 Howto

構文解析 Howto

Author

draftcode

Date

2011-11-11T13:18:07+09:00

ID

289a0136-0c1c-11e1-a06b-040ccee352e6

こうぶん、かいせきー

# -*- encoding: utf-8 -*-
"""
ticket recommendation: concept proof
"""
import pa
tickets = """
Windows環境で日本語を含むパスに対して、File.expand_path が存在しないパスを返すパターンが存在する。
Please backport thread-safe autoloading patch
Ruby 1.9.3 fails to compile in directories with accent in their names