Skip to content

Instantly share code, notes, and snippets.

@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 -)"
@braitom
braitom / .bash_pfofile
Created December 11, 2013 01:33
my mac .bash_profile
if [ -f ~/.bashrc ] ; then
. ~/.bashrc
fi
#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 / 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"];
}
}
@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
BasedOnStyle: Google
ColumnLimit: 160
IndentWidth: 4
BreakBeforeBraces: Linux
ObjCSpaceAfterProperty: true
ObjCSpaceBeforeProtocolList: true
AllowShortFunctionsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AllowShortFunctionsOnASingleLine: false
SpacesInContainerLiterals: false
@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'
@braitom
braitom / .gitignore
Created January 26, 2015 05:36
gitignore for Carthage
# Xcode
#
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
@braitom
braitom / subscribe_mqtt.py
Last active August 29, 2015 14:21
MQTT subscribe sample
# -*- coding: utf-8 -*-
import paho.mqtt.client as mqtt
def on_connect(client, userdata, flags, rc):
print("Connected with result code " + str(rc))
client.subscribe("test/iOS")
@braitom
braitom / Vagrantfile
Last active August 29, 2015 14:21
vagrantfile for influxdb 0.9.0-rc30
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
$script = <<SCRIPT
apt-get upgrade
apt-get update
echo "Asia/Tokyo" | sudo tee /etc/timezone