Skip to content

Instantly share code, notes, and snippets.

View codeboyim's full-sized avatar

codeboyim

  • Irvine, California
View GitHub Profile
@codeboyim
codeboyim / chain.js
Created November 29, 2015 06:43
a solution to implementing chaining http://www.thatjsdude.com/interview/js2.html
function exec(fn){
var doneCallback, failCallback, fnCallback, fnEnded=false, _error, _data;
exec.done = function(cb){
doneCallback = cb;
if(fnEnded && !_error){
cb(_data);
}
return exec;
};
@codeboyim
codeboyim / webpack.config.js
Last active August 29, 2015 14:08
a sample Webpack configuration to include Facebook Parse JavaScript SDK for a Web project
/**
* @file webpack.config.js
* @author codeboy<me@codeboy.im>
* @desc this gist shows the essential sections used in configuring webpack
* to make the Facebook's Parse JavaScript SDK work as other modules as expected.
* this gist is inspired by an answer to an issue reported in webpack repo
* {@link https://github.com/webpack/webpack-dev-server/issues/66}
* disclaimer: this configuration is correct as provided and effective on Parse 1.3.0
*/
@codeboyim
codeboyim / index.html
Last active September 15, 2016 09:06
Get ReactJS and Foundation.js Work Together demo: http://jsbin.com/lukako/8
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Get React and Foundation Work Together" />
<link href="http://cdnjs.cloudflare.com/ajax/libs/foundation/5.0.3/css/normalize.min.css" rel="stylesheet" type="text/css" />
<link href="http://cdnjs.cloudflare.com/ajax/libs/foundation/5.0.3/css/foundation.min.css" rel="stylesheet" type="text/css" />
<script src="http://cdnjs.cloudflare.com/ajax/libs/foundation/5.0.3/js/vendor/jquery.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/foundation/5.0.3/js/foundation.min.js"></script>
<script src="http://fb.me/react-0.11.0.js"></script>
<meta charset="utf-8">
@codeboyim
codeboyim / CSS3-Beautified-Button.html
Created January 6, 2014 12:24
A styled button made purely with cool CSS3 features, e.g. multiple border-shadow, border-radius, web font, text-shadow etc. Demo: http://jsfiddle.net/codeboy/uj9JB/
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>CSS3-Beautified Button</title>
<style>
@import url(http://weloveiconfonts.com/api/?family=typicons);
button.beautified {
display:inline-block;
@codeboyim
codeboyim / Router.js
Last active December 27, 2015 02:19
A backbonejs Router sample
(function () {
var router = null, view = null;
$(function () {
RegisterRouter = Backbone.Router.extend({
//setup route maps
routes: {
"": "list",
"list/:key/:type": "list"
},