Skip to content

Instantly share code, notes, and snippets.

View monteslu's full-sized avatar
:shipit:
crushing all the code. Mostly into reusable modules, tho

Luis Montes monteslu

:shipit:
crushing all the code. Mostly into reusable modules, tho
View GitHub Profile
@monteslu
monteslu / demo.html
Created October 13, 2010 22:51
demo
<html>
<body>
playing with gist
</body>
</html>
define([
], function(){
return function(gfxSurfaceW, gfxSurfaceH, canvasW, canvasH, borderThickness, textOffset){
var surfaceRatio = (gfxSurfaceW * 1.0) / (gfxSurfaceH * 1.0);
var canvasRatio = (canvasW * 1.0) / (canvasH * 1.0);
if(canvasRatio > surfaceRatio){
//stick box to left
var xRemaining = gfxSurfaceW - (textOffset * 2);
var pxPerInch = xRemaining / (canvasW + (borderThickness * 2));
var x = (borderThickness * pxPerInch) + textOffset;
{
"entities": [
{
"x": 1,
"y": 238,
"halfWidth": 12.5,
"halfHeight": 256,
"staticBody": true,
"zone": false,
"type": "Rectangle",
@monteslu
monteslu / fun.json
Last active December 12, 2015 10:09
some more json for the editor
{
"entities": [
{
"x": 427.5,
"y": 606.5,
"halfWidth": 425.5,
"halfHeight": 16.5,
"staticBody": true,
"zone": false,
"type": "Rectangle",
@monteslu
monteslu / gist:5828029
Created June 21, 2013 00:42
propeller
{
"entities": [
{
"points": [
{
"x": -137.33333333333334,
"y": -119.66666666666666
},
{
"x": 276.66666666666663,
@monteslu
monteslu / gist:5988968
Created July 13, 2013 01:13
more propellers
{
"entities": [
{
"x": 334,
"y": 198,
"radius": 12.041594578792296,
"staticBody": true,
"sensor": false,
"type": "Circle",
"id": "pin"
{
"entities": [
{
"x": 334,
"y": 198,
"radius": 12.041594578792296,
"staticBody": true,
"sensor": false,
"type": "Circle",
"id": "pin"
@monteslu
monteslu / loader.html
Last active December 21, 2015 02:08
loader
<html>
<head>
<script>
dojoConfig = {
baseUrl: './js',
parseOnLoad: false,
defaultDuration:1,
packages: [{
name: "app", //my own stuff
define([
'server/promised/sessions',
'when',
'lodash',
'dojo/node!https',
'server/users/main',
'dojo/node!url'
], function(sessions, when, _, https, users, url){
@monteslu
monteslu / catPhysics.json
Created January 12, 2014 21:42
Cat physics
{
"entities": [
{
"x": 264,
"y": 279,
"halfWidth": 6,
"halfHeight": 23,
"staticBody": false,
"sensor": false,
"type": "Rectangle",