Skip to content

Instantly share code, notes, and snippets.

View koji's full-sized avatar
🔍
I may be slow to respond.

koji koji

🔍
I may be slow to respond.
View GitHub Profile
@koji
koji / gist:c138f5b8236a3a9ade33
Last active August 29, 2015 14:12
Install node.js on CentOS
Before install node.js (install build tools)
$ sudo yum -y groupinstall 'Development Tools'
$ rpm -ivh http://ftp.riken.jp/Linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
$ sudo yum -y install nodejs npm --enablerepo=epel
$ node -v
@koji
koji / gist:87c75d340590f672701f
Created January 11, 2015 18:31
How to import or use Objective-C library with Swift
When I tried to use Parse SDK with swift, I just noticed how did I use Parse SDK with swift.
First, I tried to code like Objective-C. Of course, it didn’t work and it only displayed some error, “You can’t do that because you have to import Parse SDK.” After that I googled and did try & error. Finally, I could use Parse SDK with swift. So I’m gonna show you how to use Objective-C library with Swift.
Step1. Create a header file
[Create New file]-[Header file] At that time, you have to name “ProjectName-Bridging-Header.h.” It’s a rule.
If your project name is “ParseTest”, you have to name “ParseTest-Bridging-Header.h”.
Step2. Add Parse header file path
If you finish step1 well, Xcode will create the file like below
@koji
koji / gist:3da8251cbd5b3a2d1c69
Last active August 29, 2015 14:22
Uninstall npm & node
#Uninstall npm
sudo npm uninstall npm -g
#Uninstall node
lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom \
| while read i; do
sudo rm /usr/local/${i}
done
sudo rm -rf /usr/local/lib/node \
/usr/local/lib/node_modules \
@koji
koji / gist:0059f72db9345ef755c2
Last active August 29, 2015 14:22
Install nvm & node
#nvm version v0.25.4
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.25.4/install.sh | bash
#list node versions which can install
nvm ls-remote
#install node
nvm install v0.12.0
#use node
@koji
koji / csv.py
Created June 11, 2015 20:43
python create csv file
f = open('test.csv', 'ab')
csvWriter = csv.writer(f)
csvWriter.writerow(ramenInfo)
f.close()
@koji
koji / test.swift
Last active August 29, 2015 14:25
import UIKit
import AVFoundation
class ViewController: UIViewController {
// Session
var myFrontSession : AVCaptureSession!
var myBackSession : AVCaptureSession!
@koji
koji / quickreplies.js
Last active July 10, 2016 20:30
Facebook Quick Replies
function sendQuickReplies(sender) {
messageData = {
"text": "Hey!!!:",
"quick_replies": [
{
"content_type": "text",
"title": "yoyo",
"payload": "yoyo"
},
{
@koji
koji / .pryrc
Created July 12, 2016 20:23
alias for pryrc debug
if defined?(PryByebug)
Pry.commands.alias_command 'c', 'continue'
Pry.commands.alias_command 's', 'step'
Pry.commands.alias_command 'n', 'next'
Pry.commands.alias_command 'f', 'finish'
end
$ git init #Initialize git repo
$ git add -A # Add everything
$ git commit -m "comment"
$ git commit # when hit this command, vi will be started to add comment to commit. Write something and save it.
$ git show = git show HEAD
@koji
koji / sketch.ino
Created September 26, 2016 21:40
For Arduino
int rgbR = A0;
int rgbG = A1;
int rgbB = A2;
int mapR=0;
int mapG=0;
int mapB=0;
int r=0;
int g=0;
int b=0;
void setup() {