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 / getNode.js
Created April 12, 2013 23:08
getNode('console.log')('Write this to the log...') Run a command from string - no eval used for this
getNode = function(string) {
var splitString = string.split('.');
var nodeThis = window;
// Divein nodeThis
if (splitString.length)
for (var i = 0; i < splitString.length-1; i++)
if (nodeThis)
nodeThis = nodeThis[splitString[i]];
@raix
raix / controllers-demo.html
Last active December 15, 2015 05:09
Controllers proto
<head>
<title>controllers-demo</title>
</head>
<body>
<div class="container">
{{> body}}
</div>
</body>
@raix
raix / sessionExample.html
Last active December 13, 2015 19:19
Meteor nested session stuff
<head>
<title>sessionExample</title>
</head>
<body>
{{> hello}}
</body>
<template name="hello">
<h1>Hello World!</h1>
@raix
raix / apply.client.js
Last active December 10, 2015 20:18
Debug file transport
var timerTotal = self.startTimer();
var timerMeteorCall = self.startTimer();
Meteor.apply('saveChunck'+fileItem.collectionName, [
fileId = fileId,
currentChunk = chunkNumber,
countChunks = fileItem.countChunks,
data = data
],[
wait = true
@raix
raix / meteor.extractProfile.model.js
Last active December 10, 2015 09:08
Meteor.users generalized function extractProfile - Returns a basic user information object
//@Param userObjId - expects either user object or id
//
//Returns a basic user information object:
// ._id - the Meteor.users id
// .id - service id
// .accessToken - service access token
// .serviceName - name of service eg. facebook, google etc.
// .email - user email, not to be expected from twitter service
// .username - profile username
// .twitterUsername - twitters @username