Skip to content

Instantly share code, notes, and snippets.

# ORIGINAL CODE
# https://gist.github.com/wakaba/3944550#file-oauth_consumer-rb
require 'rubygems'
require 'sinatra'
require 'oauth'
require 'erb'
require 'json'
set :sessions, true
@yasuoza
yasuoza / bench_mroonga.rb
Created October 11, 2012 15:10
Benchmark for mroonga
require 'benchmark'
require 'mysql2'
DB_NAME = 'bench_mroonga'
DB_USERNAME = 'username'
DB_USERPASS = 'password'
TABLE_NAME = 'benches'
insert_cols = ['none', 'mysql', 'mroonga'].join(', ')
package main
import (
"fmt"
)
func main() {
arr := []int{10, 7, 3, 4, 6, 7, 0, 9}
arr = sort(arr)
package main
import (
"fmt"
"sync"
"time"
)
func main() {
fmt.Println(time.Now())
@yasuoza
yasuoza / Dockerfile.linux64
Last active January 2, 2019 06:04
Dockerfile for AdGuardHome
# https://github.com/AdguardTeam/AdGuardHome/blob/fd629be/Dockerfile.linux64
FROM alpine:latest
# AdGuard version
ARG ADGUARD_VERSION="0.92"
ENV ADGUARD_VERSION $ADGUARD_VERSION
# AdGuard architecture and package info
ARG ADGUARD_ARCH="linux_amd64"
ENV ADGUARD_ARCH ${ADGUARD_ARCH}
@yasuoza
yasuoza / LocalProfileInstallServer.swift
Created March 27, 2015 05:21
Install configuration profile through iOS application with CocoaHTTPServer
/*
* Be sure not to close local server at `applicationDidEnterBackground:`.
* This causes file not found error in Safari.
*/
class LocalHTTPConnection: HTTPConnection {
override func httpResponseForMethod(method: String!, URI path: String!) -> NSObject! {
if path == LocalWebViewRouter.Profile.URL.path {
return LocalProfileReponse(filePath: self.filePathForURI(path), forConnection: self)
@yasuoza
yasuoza / TDD_advent_calender_2012_22.md
Created December 22, 2012 09:11
TDDを取り入れたい誰かのために

このエントリはTDD Advent Calendar jp: 2012の22日目のエントリです。 昨日は@fukayatsuさんのTDDを続けるためにでした。

世界終わらなくてよかったですね!Hello world!

というわけで今日はTDDをチームや社内で導入するために僕がやったことや、失敗したことなどを共有できたらいいなと思い、エントリを書きます。

まず、すでに社内全体でTDDを導入できている人はこのエントリを読む必要はありません。僕に伝えられることは何もありません。ここで読み終わってOKです。

つぎに、社内やチーム内の重要ポストの人がTDDやテスト自動化なんて意味なし、無駄なことだと思っている場合は、TDDがすでに定着している会社に転職をするといいと思います。僕に伝えられることは何もありません。ここで読み終わってOKです。

require 'net/http'
require 'json'
GITLAB_URL = 'http://source.yourhost.com'
GITLAB_TOKEN = '>>>>'
BITBUCKET_OWNER = '>>>>'
BITBUCKET_PASSWORD = '>>>>'
@yasuoza
yasuoza / LTSV.pm
Last active December 16, 2015 05:09
TDDBC Tokyo 2013-03 のお題にチャレンジしてみた (お題の参考)https://github.com/sue445/tddbc_tokyo_20130316
package LTSV;
use strict;
use warnings;
use feature qw/ say /;
sub new {
my $pkg = shift;
bless{
attributes => {},
@yasuoza
yasuoza / Rakefile
Last active December 11, 2015 11:28
namespace :scala do
download_scala = 'scala-2.10.0'
def bin_files
Dir['/usr/share/scala/bin/**'].select { |file_name| file_name !~ /\.+/ }.map { |file_name| file_name.match(/(\w+)$/).captures[0] }
end
desc "Download #{download_scala}"
task :download do
if File.exist?("/tmp/#{download_scala}.tgz")