Skip to content

Instantly share code, notes, and snippets.

@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;
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 / 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>
@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 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 / 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 / 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,