Skip to content

Instantly share code, notes, and snippets.

View raix's full-sized avatar
🚀
Starting up my own thing - focus time

Morten N.O. Nørgaard Henriksen raix

🚀
Starting up my own thing - focus time
View GitHub Profile
@raix
raix / app.hackathon.sep2015.js
Last active October 10, 2015 16:09
Meteor Copenhagen hackathon - publish/restpoint data
Meteor.methods({
'addFoo': function(name) {
check(name, String);
foo.insert({ owner: this.userId, name });
}
});
@raix
raix / view.js
Last active August 29, 2015 14:16
A ultra simple view handler
if (Meteor.isClient) {
// Basic animation handling
var defer = function(current, last, scroll) {
// Set the hide class and then remove the show
$('#'+last).addClass('hide').removeClass('show');
// Remove the hide - this will make the transition fast
$('#'+current).removeClass('hide');
Meteor.setTimeout(function() {
@raix
raix / roles.js
Created February 24, 2015 15:56
Roles
roleTypes = {
'admin': 'Administrator',
'user': 'Bruger',
'editor': 'Redaktør',
};
roleTypesList = [];
_.each(roleTypes, function(val, key) {
roleTypesList.push({
@raix
raix / test.md
Last active August 29, 2015 14:11
test changelog
@raix
raix / viewport.js
Created June 25, 2014 05:10
Paginated viewport in Meteor/Famo.us/Famono
if (Meteor.isClient) {
// Rig some famo.us deps
//famousPolyfills;
famous.polyfills;
famous.core.famous;
// Make sure dom got a body...
Meteor.startup(function() {
@raix
raix / image-uploader.html
Last active October 13, 2023 00:08
cfs image uploader example
<template name="imageUploader">
<h2>Picture</h2>
<p>
{{#each images}}
<img src="{{url}}" alt="">
<input type="button" value="remove" class="btnRemove"/>
{{else}}
No files uploaded.
{{/each}}
</p>
@raix
raix / argumentparser.js
Last active December 27, 2015 18:59
An idea for parsing arguments in Meteor.js With this code declaring interfaces and validating input just got a bit easier..
typeNames = function(type) {
if (Match.test(type, [Match.Any])) return 'array';
if (type === Object) return 'object';
if (type === String) return 'string';
if (type === Number) return 'number';
if (type === Boolean) return 'boolean';
if (type === Function) return 'function';
return typeof type;
};
@raix
raix / app.manifest
Last active December 20, 2015 13:59
Meteor and phonegap thoughts
CACHE MANIFEST
# cafd1417c9861bbd29cd844d8f380b340c70d316
CACHE:
/
http://grounddb.meteor.com/dbcdebadd4b96a6b5fd50c4cec204ed1f73a3398.js
http://grounddb.meteor.com/aa67ef88b25b2dba7b045b5f9307fc2f16573731.css
http://grounddb.meteor.com/green.png?cac3cc0143b7e79be4ce2682288ad2ec69882407
http://grounddb.meteor.com/red.png?d9d4f943b535801166a198aec7e28799475dc1e6
@raix
raix / syntaxTreeAfter
Last active December 20, 2015 00:09
Syntax tree Meteor.isClient = false
// code = 'server';
{
"type": "Program",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "AssignmentExpression",
"operator": "=",
@raix
raix / debugRendered.js
Created May 17, 2013 13:10
Debuggin template rendering in Meteor. I had a template problem when creating a spreatsheet like app - optimizing usage of templates and dependenies is important when going mobile. I created this snippet of code to repport in on Template rendering.
var renderList = [];
var timer = 0;
var timeToLog = 100;
function debugRendered(templateName) {
// init renderList
renderList[templateName] = 0;