Skip to content

Instantly share code, notes, and snippets.

@braitom
braitom / gitlab.coffee
Last active August 29, 2015 14:11
hubot-gitlab mearge request review
https = require('https')
random = require('hubot').Response::random
BASE_URL = 'https://slack.com/api/chat.postMessage?token=xxxx-xxxxxxxxx-xxxxxxxxxx-xxxxxxxxx-xxxxxxx' #replace your Slack API key!
members = [ #replae and add your team members!
'aaa',
'bbb',
'ccc',
'ddd'
BasedOnStyle: Google
ColumnLimit: 160
IndentWidth: 4
BreakBeforeBraces: Linux
ObjCSpaceAfterProperty: true
ObjCSpaceBeforeProtocolList: true
AllowShortFunctionsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AllowShortFunctionsOnASingleLine: false
SpacesInContainerLiterals: false
@braitom
braitom / gist:11284663
Created April 25, 2014 10:20
docker install
sudo apt-get update
sudo apt-get install linux-image-generic-lts-raring linux-headers-generic-lts-raring
sudo reboot
sudo sh -c "wget -qO- https://get.docker.io/gpg | apt-key add -"
sudo sh -c "echo deb http://get.docker.io/ubuntu docker main\ > /etc/apt/sources.list.d/docker.list"
sudo apt-get update
sudo apt-get install lxc-docker
@braitom
braitom / DetailViewController.m
Created March 20, 2014 07:39
OutletコレクションのUIImageViewでとある言葉によって出す画像を変える
- (void)imageSelector:(NSArray *)statusList status:(NSString *)status index:(NSUInteger)index trueWord:(NSString *)word {
UIImageView *statusColor = statusList[index];
if ([status isEqualToString:word]) {
statusColor.image = [UIImage imageNamed:@"green_circle"];
} else {
statusColor.image = [UIImage imageNamed:@"red_circle"];
}
}
#pragma mark - fetchSSID
- (id)fetchSSIDInfo {
NSArray *ifs = (__bridge_transfer id) CNCopySupportedInterfaces();
NSLog(@"Supported interfaces: %@", ifs);
id info = nil;
for (NSString *ifnam in ifs) {
info = (__bridge_transfer id) CNCopyCurrentNetworkInfo((__bridge CFStringRef) ifnam);
NSLog(@"%@ => %@", ifnam, info);
if (info && [info count]) {break;}
}
@braitom
braitom / .bash_pfofile
Created December 11, 2013 01:33
my mac .bash_profile
if [ -f ~/.bashrc ] ; then
. ~/.bashrc
fi
@braitom
braitom / .bashrc
Created December 11, 2013 01:32
my mac's .bashrc
#nodebrew
if [[ -f ~/.nodebrew/nodebrew ]]; then
export PATH=$HOME/.nodebrew/current/bin:$PATH
nodebrew use v0.10
fi
#pyenv
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"