Skip to content

Instantly share code, notes, and snippets.

View Obooman's full-sized avatar

Oboo Cheng Obooman

View GitHub Profile
@Obooman
Obooman / integrate react-native to swift project.md
Created November 6, 2017 06:25 — forked from boopathi/README.md
Creating a Swift-ReactNative project

Settings

  1. Create a project in XCode with the default settings
    • iOS > Application > Single View Application
    • Language: Swift
  2. Under project General settings, add ReactKit to Linked Framework and Libraries
    • + > Add Other... and choose /path/to/react-native/ReactKit/ReactKit.xcodeproj
  3. Now ReactKit would have been imported. Link it by choosing it from the list.
    • + > lib.ReactKit.a
  4. Under project Build Settings,
@Obooman
Obooman / 0_reuse_code.js
Created June 30, 2017 03:46
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@Obooman
Obooman / app.js
Created April 4, 2017 10:27 — forked from bingeboy/app.js
Upload and display image with NodeJS and Express.
/*
* Module dependencies.
*/
var express = require('express')
, routes = require('./routes')
, user = require('./routes/user')
, common = require('./routes/common')
, fs = require('fs')
, http = require('http')
, util = require('util')
@Obooman
Obooman / grant_root_remote_access.txt
Created March 23, 2017 13:28 — forked from tinchodev/grant_root_remote_access.txt
Grant Root Remote Access MySQL
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;
FLUSH PRIVILEGES;
Edit /etc/mysql/my.cnf
Comment address binding bind-address = 127.0.0.1 to #bind-address = 127.0.0.1
@Obooman
Obooman / gh-pages-deploy.md
Created February 10, 2017 16:05 — forked from cobyism/gh-pages-deploy.md
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@Obooman
Obooman / introrx.md
Last active February 6, 2017 11:24 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@Obooman
Obooman / qrsqrt.js
Created January 3, 2017 07:29
Quakes's fast inverse square root algorithm, in JavaScript
/**
* References:
* [1] ftp://ftp.idsoftware.com/idstuff/source/quake3-1.32b-source.zip
* [2] http://www.lomont.org/Math/Papers/2003/InvSqrt.pdf
* [3] http://en.wikipedia.org/wiki/Newton%27s_method
* [4] https://developer.mozilla.org/en/JavaScript_typed_arrays
* [5] http://en.wikipedia.org/wiki/Fast_inverse_square_root
*/
const QUAKEx32 = 0x5f3759df
@Obooman
Obooman / gist:81d44215c5fc8c136819f21f75421e00
Created October 17, 2016 02:41 — forked from gistforme/gist:2398124
HTML4: Starting Template
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
</head>
<body>
@Obooman
Obooman / nginx.conf
Created August 17, 2016 03:53 — forked from thoop/nginx.conf
Official prerender.io nginx.conf for nginx
# Change YOUR_TOKEN to your prerender token and uncomment that line if you want to cache urls and view crawl stats
# Change example.com (server_name) to your website url
# Change /path/to/your/root to the correct value
server {
listen 80;
server_name example.com;
root /path/to/your/root;
index index.html;
@Obooman
Obooman / google.sh
Created May 14, 2016 14:26 — forked from deanet/google.sh
Uploading File into Google Drive (because grive too many dependencies qt, xorg ? )
#!/bin/bash
## uploading to google
## rev: 22 Aug 2012 16:07
det=`date +%F`
browser="Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:13.0) Gecko/20100101 Firefox/13.0.1"
username="user@domain-apps.com"
password="password"
accountype="HOSTED" #gooApps = HOSTED , gmail=GOOGLE