Skip to content

Instantly share code, notes, and snippets.

@samme
samme / ScaleX.js
Last active April 24, 2020 15:55 — forked from nicoptere/ScaleX
Performs a scale2x and scale3x operation on a HTML canvas
/*
JavaScript port of <http://scale2x.sourceforge.net/algorithm.html>
*/
var scaleX = (function (exports) {
function getPixel32(data, x, y, w) {
var id = (x + y * w) * 4;
return (data[id] << 16) | (data[id + 1] << 8) | data[id + 2];
}
@samme
samme / base.js
Last active July 18, 2023 22:10 — forked from tickle-monster/base.js
Phaser 3 BaseScene
export class BaseScene extends Phaser.Scene
{
constructor(config)
{
super(config);
}
init()
{
this.user = this.registry.get('user');
/* jQuery Quantum Pub/Sub
* -- from --
* jQuery Tiny Pub/Sub v0.7 (http://benalman.com)
* Copyright (c) 2011 "Cowboy" Ben Alman; Licensed MIT, GPL */
(function( $ ) {
var o = $( {} ),
fn = $.fn,
proxy = $.proxy;
@samme
samme / html2haml-recursive.sh
Last active December 21, 2015 13:19 — forked from ebeigarts/gist:970898
Search directory & convert .html to .haml.
# gem install html2haml --prerelease
for f in $(find . -type f -name \*.html); do echo "$f -> $f.haml" && html2haml --ruby19-attributes $f > "$f.haml"; done