Skip to content

Instantly share code, notes, and snippets.

Avatar

Motokazu Sekine cheebow

View GitHub Profile
@cheebow
cheebow / tif2016.rb
Created Jul 21, 2016
TIF2016出演アイドル別に出演時間を表示する
View tif2016.rb
require 'open-uri'
require 'json'
response = open('http://www.idolfes.com/2016/json/timetable/time.json')
data = response.read
json = JSON.parse(data)
artists = {}
json.keys.each{|day|
json[day].keys.each{|stage|
@cheebow
cheebow / Utils.swift
Last active Oct 23, 2015
performAfterDelay
View Utils.swift
import Foundation
class Utils {
class func performAfterDelay(block: dispatch_block_t, delayTime: Double) {
let delay = delayTime * Double(NSEC_PER_SEC)
let time = dispatch_time(DISPATCH_TIME_NOW, Int64(delay))
dispatch_after(time, dispatch_get_main_queue(), block)
}
}
@cheebow
cheebow / gist:b37e4e5c9cc5b63d83e5
Created Aug 14, 2015
ナビゲーションバーの下線を消す
View gist:b37e4e5c9cc5b63d83e5
UINavigationBar.self.appearance().setBackgroundImage(UIImage(), forBarMetrics: UIBarMetrics.Default)
UINavigationBar.self.appearance().shadowImage = UIImage()
View ColorButton.swift
import UIKit
class ColorButton: UIButton {
func setBackgroundColor(color: UIColor, forState state: UIControlState) {
self.setBackgroundImage(self.colorImage(color), forState: state)
}
func colorImage(color: UIColor)-> UIImage {
let size = CGSizeMake(1.0, 1.0)
let rect = CGRect(origin: CGPointZero, size: size)
View gist:5655d30b8ae893affc24
// ==UserScript==
// @name showroom star aggregator
// @namespace http://nipotan.com/
// @version 0.8
// @description 特定のルームには連射ボタン等があり、他は閉じるだけ
// @match https://www.showroom-live.com/*
// @grant none
// @copyright 2014 nipotan
// ==/UserScript==
$(document).ready(function(){
@cheebow
cheebow / MYViewController.h
Last active Dec 24, 2015
CMStepCounter Sample
View MYViewController.h
#import <UIKit/UIKit.h>
#import <CoreMotion/CoreMotion.h>
@interface MYViewController : UIViewController
@property (nonatomic, strong) CMStepCounter *stepCounter;
@end
@cheebow
cheebow / gist:5036922
Created Feb 26, 2013
UISliderを縦にする
View gist:5036922
- (void)viewDidLoad
{
[super viewDidLoad];
UISlider *slider = [[UISlider alloc] init];
slider.center = self.view.center;
slider.transform = CGAffineTransformMakeRotation(M_PI * -90.0 / 180.0);
[self.view addSubview:slider];
[slider autorelease];
}