Skip to content

Instantly share code, notes, and snippets.

@dictav
dictav / git-tickets
Created June 10, 2013 02:04
Bitbucket の issue を使って TiDD を目指す
#! /usr/bin/env ruby
require 'net/https'
require 'cgi'
require 'json'
require 'time'
require 'thor'
class GitTickets < Thor
@dictav
dictav / gist:5897984
Created July 1, 2013 02:26
malloc のテストする時に書いたの
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <dispatch/dispatch.h>
#include <sys/types.h>
#include <unistd.h>
#define NUMBER_OF_LOOP 10000000
#define BUFFER_SIZE 1000
@dictav
dictav / gist:6303256
Created August 22, 2013 04:34
日本の市町村の緯度経度を JSON 形式にまとめました
/* http://gps.ayapani.com 参考 */
[
{
"name": "群馬県",
"cities": [
{
"name": "前橋市",
"latitude": "36.2322",
"longitude": "139.0347"
},
// navigation bar の背景画像を設定
[[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"navigationbar.png"]
forBarMetrics:UIBarMetricsDefault];
UIImage *backButtonImage = [[UIImage imageNamed:@"back.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 28, 0, 0)];
[[UIBarButtonItem appearance] setBackButtonBackgroundImage:backButtonImage
forState:UIControlStateNormal
barMetrics:UIBarMetricsDefault];
[[UIBarButtonItem appearance] setBackButtonTitlePositionAdjustment:UIOffsetMake(-100, 0)
@dictav
dictav / NSOperationQueue+Block
Created March 10, 2014 10:13
Add [NSOperationQueue addOperationWithBlock:]
@interface NSOperationQueue (Block)
- (void)addOperationWithBlock:(void (^)(void))block;
@end
@implementation NSOperationQueue (Block)
- (void)addOperationWithBlock:(void (^)(void))block
{
NSInvocationOperation *op;
op = [[NSInvocationOperation alloc] initWithTarget:self
selector: @selector(doBlock:)
@dictav
dictav / gist:10000668
Last active August 29, 2015 13:58
2014年、いしかわドライブ旅行

日程

初日

長旅なので、初日はちょっと良い温泉でまったり

  • 9:00 出発
    • ドライブ
  • 12:00 富山でランチ
    • ドライブ
  • 16:00 山中温泉: かがり吉祥寺着(1日目宿)
  • まったり過ごす
package main
import (
"fmt"
"github.com/PuerkitoBio/goquery"
"strings"
)
func main() {
url := "http://connpass.com/event/6370/participation/"
@dictav
dictav / gurad-selenium.rb
Last active August 29, 2015 14:03
Guard::Selenium starts your Selenium server
module ::Guard
class Selenium < Guard
def start
puts "Starting Selenium on port TODO"
IO.popen(executable)
puts "Selenium is running with PID #{pid}"
$?.success?
end
def stop
@dictav
dictav / not_type_class.go
Last active August 29, 2015 14:03
型クラスとかそんなの意識したけど結局できなかったもの
package main
import (
"fmt"
)
type Any interface{}
type Incrementer interface {
increment() Any
@dictav
dictav / hello.swift
Created July 5, 2014 01:36
Hello, Swift!
#! /Applications/Xcode6-Beta2.app/Contents/Developer/usr/bin/xcrun swift -i
println("Hello, Swift!")