Skip to content

Instantly share code, notes, and snippets.

🚀
Rocket Science

Christian Engel Paratron

🚀
Rocket Science
Block or report user

Report or block Paratron

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
View Create react app with custom scripts.sh
# With SASS
create-react-app APPNAME --scripts-version custom-react-scripts
# With typescript
create-react-app APPNAME --scripts-version=react-scripts-ts
View drawPoligon.js
/**
* Draws a poligon - can draw anything from a triangle to a star.
* Source and demo: http://jsfiddle.net/tohan/8vwjn4cx/
*/
function drawShape(ctx, x, y, points, radius1, radius2, alpha0) {
//points: number of points (or number of sides for polygons)
//radius1: "outer" radius of the star
//radius2: "inner" radius of the star (if equal to radius1, a polygon is drawn)
//angle0: initial angle (clockwise), by default, stars and polygons are 'pointing' up
var i, angle, radius;
@Paratron
Paratron / door.js
Created Oct 16, 2014
Alternative constructor prototype
View door.js
var Door = function Door(){
};
Door.prototype = {
constructor: Door,
name: 'Door',
hp: 5,
char: '+',
color: 'yellow',
@Paratron
Paratron / twig_init.php
Created Aug 7, 2014
Twig Template Engine Bootstrap
View twig_init.php
require('lib/php/Twig/Autoloader.php');
Twig_Autoloader::register();
$loader = new Twig_Loader_Filesystem('lib/templates');
$twig = new Twig_Environment($loader);
View isofix.js
/**
* Renders the tiles to the layer canvas and pushes to the display.
* @method Phaser.TilemapLayer#render
* @memberof Phaser.TilemapLayer
*/
Phaser.TilemapLayer.prototype.render = function () {
if (this.layer.dirty)
{
this.dirty = true;
@Paratron
Paratron / agents.md
Last active Sep 5, 2018
Social Network Crawler User Agents
View agents.md

#Social Network Crawler User Agents Users can post URLs on a lot of different platforms nowadays. Most of those platforms will send a request to that URL to generate some preview data from it.

These are a couple of user agents I quickly tested out.

##Facebook

facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)
@Paratron
Paratron / undo_redo.js
Created Jul 31, 2013
Easy undo/redo with backbone
View undo_redo.js
this.on('change', function(){
changes.push(this.previousAttributes());
});
undo: function(){
undone.push(this.toJSON());
this.set(changes.pop());
}
redo: function(){
@Paratron
Paratron / raf-polyfill.js
Created Apr 29, 2013
A Polyfill for window.requestAnimationFrame()
View raf-polyfill.js
(function() {
var lastTime = 0;
var vendors = ['webkit', 'moz'];
for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame'];
window.cancelAnimationFrame =
window[vendors[x]+'CancelAnimationFrame'] || window[vendors[x]+'CancelRequestAnimationFrame'];
}
if (!window.requestAnimationFrame)
View cargo_draft.js
//Cargo Asset Loader
//===================
//This file defines the API for a HTML5 asset loader that is mainly designed to be used for games
//but could be used for any kind of HTML5 application that requires some kind of asset management.
//@version: 1 (April 1st, 2013)
//@author: Christian Engel <hello@wearekiss.com>
//The Cargo asset loader should deliver the following number of features:
View Short Timer.js
/**
* Short Countdown
* ===============
* This is my try of a short JavaScript Countdown.
* Line breaks and identation added for better reading.
* Line 2 could be boiled down to:
* e = +new d()+36E5;
* But the way it is right now makes it much easier to tweak the duration.
*
* Character count with whitespace trimmed: 178.
You can’t perform that action at this time.