Skip to content

Instantly share code, notes, and snippets.

View limweb's full-sized avatar

Thongchai Lim (样生海) limweb

View GitHub Profile
<?php
use Facebook\FacebookSession;
use Facebook\FacebookRequest;
use Facebook\GraphUser;
use Facebook\FacebookRequestException;
FacebookSession::setDefaultApplication('YOUR_APP_ID','YOUR_APP_SECRET');
// Use one of the helper classes to get a FacebookSession object.
// FacebookRedirectLoginHelper
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)
Google Apps for Android 4.4.4 (https://www.androidfilehost.com/?fid=23501681358544845 - gapps-kk-20140606-signed.zip)
Google Apps for Android 4.3 (https://www.androidfilehost.com/?fid=23060877490000124 - gapps-jb-20130813-signed.zip)
Google Apps for Android 4.2 (https://www.androidfilehost.com/?fid=23060877490000128 - gapps-jb-20130812-signed.zip)
Google Apps for Android 4.1 (https://www.androidfilehost.com/?fid=22979706399755082 - gapps-jb-20121011-signed.zip)
@limweb
limweb / gist:7cc39b46b7bf7260bfa6
Last active August 29, 2015 14:27 — forked from zxcvbnm4709/gist:2656197
include jQuery in Chrome Console
var script = document.createElement("script");
script.setAttribute("src", "http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js");
script.addEventListener('load', function() {
var script = document.createElement("script");
document.body.appendChild(script);
}, false);
document.body.appendChild(script);
@limweb
limweb / index.js
Last active October 26, 2015 23:27 — forked from teepluss/index.js
React Redux Example
import React, { PropTypes } from 'react'
import ReactDOM from 'react-dom'
import { createStore,combineReducers,applyMiddleware } from 'redux'
import { Provider, connect,thunk } from 'react-redux'
import _ from 'lodash'
// Main component.
class Main extends React.Component {
@limweb
limweb / minCounter.js
Created February 19, 2016 10:58 — forked from namelos/minCounter.js
Minimalist redux example
import React, { Component } from 'react'
import { render } from 'react-dom'
import { createStore, bindActionCreators } from 'redux'
import { connect, Provider } from 'react-redux'
const increment = () => ({ type: 'increment' })
const counter = (state = 0, action) => {
switch (action.type) {
@limweb
limweb / ng-directive-inline-multi-line-template-string.es6.js
Last active February 26, 2016 04:14 — forked from zachlysobey/ng-directive-inline-multi-line-template-string.es6.js
Angular 1 Directive with ES6 Multi-line string template inline.
(function() {
'use strict';
angular
.module('myModule')
.directive('myDirective', myDirective);
const template = `
<div class="my-directive-template">
<h1>Using multi-line Strings for templates</h1>
@limweb
limweb / my.cnf
Created September 11, 2017 08:22 — forked from kenelliott/my.cnf
16CPU / 16GB My.cnf
[mysqld_safe]
nice = -15
[mysqld]
max_binlog_size = 256M #max size for binlog before rolling
expire_logs_days = 1 #binlog files older than this will be purged
## Per-Thread Buffers * (max_connections) = total per-thread mem usage
thread_stack = 256K #default: 32bit: 192K, 64bit: 256K
sort_buffer_size = 1M #default: 2M, larger may cause perf issues
@limweb
limweb / promises_reduce.js
Created November 2, 2017 04:56 — forked from anvk/promises_reduce.js
Sequential execution of Promises using reduce()
function asyncFunc(e) {
return new Promise((resolve, reject) => {
setTimeout(() => resolve(e), e * 1000);
});
}
const arr = [1, 2, 3];
let final = [];
function workMyCollection(arr) {
@limweb
limweb / Foo.php
Created November 12, 2017 17:41 — forked from h-collector/Foo.php
Standalone Laravel Queue + Redis example
<?php
namespace Jobs;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Redis\Database as Redis;
class Foo extends Job
{
use InteractsWithQueue;
@limweb
limweb / bootstrap.php
Created November 13, 2017 04:22 — forked from pascal08/bootstrap.php
Laravel 5.4 Queue Standalone
<?php
require_once 'vendor/autoload.php';
require_once 'container.php';
$app = Container::getInstance();
$app->bind('database', function($app) {
$database = new Illuminate\Database\Capsule\Manager($app);