Skip to content

Instantly share code, notes, and snippets.

View rvanzon's full-sized avatar

Richard van Zon rvanzon

View GitHub Profile
@rvanzon
rvanzon / gist:442f16ea7db5f7b03fc3
Created July 16, 2014 08:38
RHashManager, connect location.has to CPNotificationCenter
//
// RHashManager
// by Richard van Zon (c) Relectus
//
// Public Domain
//
@import <Foundation/CPObject.j>
var sharedHashManager = nil;
@rvanzon
rvanzon / gist:ea17d4bd6c1437d821a2
Last active August 29, 2015 14:15
CollisionStateEntity for MelonJS
game.CollisionStateEntity = me.Entity.extend({
init: function(x, y, settings) {
this._super(me.Entity, 'init', [x, y , settings]);
this.entitiesInside = {};
this.entitiesInsideThisFrame = {};
},
update: function (dt) {
@rvanzon
rvanzon / gist:044f7d0dbbc7bdf04ea2
Created February 23, 2015 06:51
MelonJS ES 6 concept
class Player extends meEntity {
constructor(x, y, settings) {
super(x, y, settings);
}
update(dt) {
super.update(dt);
}
onCollision(a, b) {
return false;
}
@rvanzon
rvanzon / bundle.js
Last active August 29, 2015 14:17
Jay-inheritance + Webpack
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;
@rvanzon
rvanzon / gist:5063439
Last active December 14, 2015 09:18
Adding performSelector:withObject:afterDelay:aDelay to the Objective-J Foundation
@implementation CPObject(delayedSelectorPerforming)
{
}
- (void)performSelector:(SEL)aSelector withObject:(id)anObject afterDelay:(CPTimeInterval)aDelay
{
setTimeout(function() { objj_msgSend(self, aSelector, anObject); }, aDelay * 1000);
}
@end
@rvanzon
rvanzon / autoreload.js
Created April 11, 2016 14:17
Sails - autoreload.js
// config/autoreload.js
module.exports.autoreload = {
active: true,
usePolling: false,
dirs: [
"api/models",
"api/controllers",
"api/services",
"config/locales"
],
@rvanzon
rvanzon / compileAssets.js
Last active April 11, 2016 14:37
Sails - add Stylus-support
// tasks/register/compileAssets.js
module.exports = function (grunt) {
grunt.registerTask('compileAssets', [
'clean:dev',
'jst:dev',
'less:dev',
'copy:dev',
'coffee:dev',
'stylus:dev'
]);
@rvanzon
rvanzon / http.js
Created April 11, 2016 15:48
Sails - add a static client (/public)
/**
* HTTP Server Settings
* (sails.config.http)
*
* Configuration for the underlying HTTP server in Sails.
* Only applies to HTTP requests (not WebSockets)
*
* For more information on configuration, check out:
* http://sailsjs.org/#!/documentation/reference/sails.config/sails.config.http.html
*/
@rvanzon
rvanzon / 0_reuse_code.js
Created May 2, 2017 07:44
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@rvanzon
rvanzon / readme.md
Last active November 8, 2017 21:08
Using Framework7-Vue from GitHub (instead of NPM)
  1. create a directory to place the framework.
  2. clone the repository git clone https://github.com/nolimits4web/Framework7-Vue
  3. cd Framework7-Vue
  4. npm install
  5. npm run dist
  6. go to your project and remove the Framework7-Vue: npm remove Framework7-Vue
  7. link the new package you just build: npm link <path to Framework7-Vue>

That's it!