Skip to content

Instantly share code, notes, and snippets.

View chain.js
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 Aug 29, 2015
a sample Webpack configuration to include Facebook Parse JavaScript SDK for a Web project
View webpack.config.js
/**
* @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 Sep 15, 2016
Get ReactJS and Foundation.js Work Together demo: http://jsbin.com/lukako/8
View index.html
<!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 Jan 6, 2014
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/
View CSS3-Beautified-Button.html
<!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 Dec 27, 2015
A backbonejs Router sample
View Router.js
(function () {
var router = null, view = null;
$(function () {
RegisterRouter = Backbone.Router.extend({
//setup route maps
routes: {
"": "list",
"list/:key/:type": "list"
},