Skip to content

Instantly share code, notes, and snippets.

Pedro Casaubon xperiments

Block or report user

Report or block xperiments

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@diverted247
diverted247 / gulpfile.js
Created May 1, 2014
A Gulp + TypeScript + Component Build script
View gulpfile.js
var gulp = require( 'gulp' ),
component = require( 'gulp-component' ),
tsc = require( 'gulp-typescript-compiler' );
gulp.task( 'default' , [ 'ts' ] , function (){
gulp.src( 'component.json' )
.pipe( component( {
standalone: true
} ) )
.pipe( gulp.dest( 'build' ) )
View 01_1Scope.js
(function() {
const a=10;
a=20;
let b=10;
b=20;
console.log("a-->" + a);
console.log("b-->" + b);
var s = true;
while (s) {
const ic = 10;
@michelsalib
michelsalib / timestampable.ts
Created Apr 22, 2015
Typescript @timestampable annotation
View timestampable.ts
@timestampable
class Dog {
public name: string = 'Paul';
}
function timestampable(func) {
return <any>(function() {
var genericConstructor = () => {};
genericConstructor.prototype = func.prototype;
var instance = new genericConstructor();
@daoshengmu
daoshengmu / webgl-tpe-02-simpleWebVR03.html
Last active Sep 3, 2015
WebGL Taipei meetup #03: WebVR Oculus / Cardboard controls
View webgl-tpe-02-simpleWebVR03.html
<!DOCTYPE html>
<!--
WebGL Taipei meetup #02
author: daoshengmu, http://dsmu.me
date: 06/06/2015
-->
<html lang="en">
<head>
View string_subclassing.js
function Markdown(value) {
this.value = value || '';
this.length = this.value.length;
};
Markdown.prototype = new String;
// Instance methods
Markdown.prototype.toString = Markdown.prototype.valueOf = function(){return this.value};
Markdown.prototype.toHTML = function(){return Markdown.decode(this)};
View classList.js
/*
* Minimal classList shim
* Use with an Array.prototype.indexOf shim to support IE 8
* Derived from work by Devon Govett
* MIT LICENSE
*/
// NOT INTENDED FOR PRODUCTION USE.
@assertchris
assertchris / t.js
Created Sep 28, 2012 — forked from wayneashleyberry/t.js
simple templating
View t.js
/**
* simple mustache-like templater
* http://mir.aculo.us/2011/03/09/little-helpers-a-tweet-sized-javascript-templating-engine/
* -----------------------------------------------------------------------------------------
* t('Hello, {{planet}}!', {'planet': 'World'});
* returns 'Hello, World!';
*/
function t(s,d){
for(var p in d)
s=s.replace(new RegExp('{{'+p+'}}','g'), d[p]);
@stoikerty
stoikerty / gist:40ee7d3ee6016a485092
Last active Dec 5, 2015
Mixin for creating Google’s “Material Design” in SCSS
View gist:40ee7d3ee6016a485092
// Creating Google’s “Material Design” in SCSS
// (specifically Material Shadow, uses compass)
// see: http://www.google.com/design/spec/layout/layout-principles.html#layout-principles-paper-craft
// Demo: http://codepen.io/stoikerty/full/Glwxi/
// Animating Box-Shadow is EXPENSIVE:
// http://www.html5rocks.com/en/tutorials/speed/high-performance-animations/#toc-
// Moving between z-index-depths is done via opacity & multiple
View gist:6228063
if("undefined" === typeof document.currentScript){
(function(){
/***************************************************************************/
/* document.currentScript polyfill + improvements */
/***************************************************************************/
var scripts = document.getElementsByTagName('script');
document._currentScript = document.currentScript;
// return script object based off of src
var getScriptFromURL = function(url) {
@Ciantic
Ciantic / MyElement.ts
Last active Jan 28, 2016
CustomElement inheritance in TypeScript (before it's fixed)
View MyElement.ts
import customelement = require('./customelement');
export class MyElement extends customelement.CustomHTMLElement {
public myTest() {
// "this" is fully qualified, includes all methods e.g. addEventListener, dispatchEvent
console.log("this", this);
console.dir(this);
}
}
You can’t perform that action at this time.