Skip to content

Instantly share code, notes, and snippets.

@pc035860
pc035860 / request_fb_token.js
Created July 3, 2012 03:01
Facebook connect for Windows 8 metro style apps
/**
* Ask user for facebook connect & get the accesstoken
*
* @param {Object} options
* @param {Function} callback
* @param {Function} error_handler (optional)
**/
function requestFbToken (options, callback, error_handler) {
options = _extend({
appId: null,
@pc035860
pc035860 / gist:3104034
Created July 13, 2012 10:05
Make direct command on Metro style app settings (JavaScript)
(function () {
var standard_commands,
special_commands;
standard_commands = {
game: {title: 'game settings'}
};
special_commands = {
@pc035860
pc035860 / index.html
Created April 11, 2013 13:36
CSS3 Transition effect demo
<ul>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
<select>
@pc035860
pc035860 / index.html
Created April 11, 2013 13:37
A CodePen by Robin Fan. Move alone an Chart.js path - as title, draws by sampling from off-screen canvas
<div id="stage">
<div id="char"></div>
<div id="wrap">
<canvas id="main" width="900" height="400"></canvas>
</div>
</div>
<div id="debug"></div>
@pc035860
pc035860 / index.html
Created May 23, 2013 18:04
A CodePen by Robin Fan. Rounded square counter - prototype
<div class="word">
<div class="square"></div>
<div class="square no1"></div>
<div class="square no2"></div>
<div class="square no3"></div>
<div class="square no4"></div>
</div>
<div class="time">
<div class="square"></div>
<div class="square no1"></div>
Drop in replace functions for setTimeout() & setInterval() that
make use of requestAnimationFrame() for performance where available
http://www.joelambert.co.uk
Copyright 2011, Joe Lambert.
Free to use under the MIT license.
http://www.opensource.org/licenses/mit-license.php
@pc035860
pc035860 / hljsToJson.js
Created August 6, 2013 15:05
A directive highlights a served object with JSON format with angular-highlightjs.
angular.module('myApp')
.directive('hljsToJson', [function () {
return {
restrict: 'EA',
scope: {
obj: '=hljsToJson'
},
template: '<div hljs source="prettyJSON"></div>',
link: function postLink(scope, iElm, iAttrs) {
var tabWidth = 4;
@pc035860
pc035860 / angularjs.directive.submitIt.js
Created September 7, 2013 02:24
AngularJS submitIt module
angular.module('submitIt', [])
/**
* @ngdoc directive
* @description form submission trigger
*
* @param {boolean} submit-it submit form on `true`
* @param {string} si-action submit action(optional)
* @param {string} si-method submit method(optional)
*/
@pc035860
pc035860 / randInt.js
Created September 13, 2013 04:02 — forked from gengkev/randInt.js
function randInt(min,max){
var range = max - min;
// it actually does work the other way...
// if (range < 0) { throw new RangeError("min must be less than max"); }
var rand = Math.floor(Math.random() * (range + 1));
return min + rand;
}
@pc035860
pc035860 / scopes.txt
Created September 16, 2013 09:30 — forked from iambibhas/scopes.txt
Here is a list of scopes to use in Sublime Text 2 snippets -
ActionScript: source.actionscript.2
AppleScript: source.applescript
ASP: source.asp
Batch FIle: source.dosbatch
C#: source.cs
C++: source.c++
Clojure: source.clojure
CSS: source.css