Skip to content

Instantly share code, notes, and snippets.

View lvbreda's full-sized avatar

Lander Van Breda lvbreda

  • Youbba, myself
  • Belgium
View GitHub Profile
@lvbreda
lvbreda / gist:2915909
Created June 12, 2012 07:34
Tryout for a temp package system meteor
{
"entries": {
"crypt": {
"name": "crypt",
"location": "https://github.com/lvbreda/metCrypt.git",
"dep": {}
}
}
}
<head>
<title>qrcode</title>
</head>
<body>
{{> qrcode}}
{{> image}}
</body>
@lvbreda
lvbreda / gist:3182189
Created July 26, 2012 13:58
XML parser
function parseXml(xml)
{
$("#info").html('');
//print each tutorial title followed by their categories
$(xml).find("faktura").each(function()
{
var daty = $("</div").addClass("daty");
daty.append('<p class="daty">Wystawiono: ' + $(this).find("wyst").text() + "</p>");
daty.append('<p class="daty">Sprzedano: ' + $(this).find("sprz").text() + "</p>");
var router = Backbone.Router.extend({
routes: {
":page" : "main"
},
main: function (page) {
document.body.innerHTML = "";
var frag = Meteor.ui.render(function () {
if(Template[page]){
return Template[page]();
}
@lvbreda
lvbreda / stackover.html
Created July 31, 2012 21:54
Rendering MongoDB documents with Meteor
<head>
<title>Stackoverflow</title>
</head>
<body>
{{> hello}}
</body>
<template name="hello">
<ul>
@lvbreda
lvbreda / client.js
Created July 31, 2012 22:16
Hacky routing
if (Meteor.is_client) {
var Router = Backbone.Router.extend({
routes: {
"" : "main",
":page": "main" //this will be http://your_domain/
},
main: function(page) {
document.body.innerHTML = "";
page = page?page:"index";
var frag = Meteor.ui.render(function () {
@lvbreda
lvbreda / server.js
Created July 31, 2012 23:21
Server routing
__meteor_bootstrap__.app
.use(connect.query())
.use(function (req, res, next) {
// Need to create a Fiber since we're using synchronous http calls
Fiber(function() {
if({{yourcheck}}){
res.writeHead(200, {'Content-Type': 'text/html'});
res.write("blabla");
res.end();
Players = new Meteor.Collection('players');
Players.allow({
insert: function (userId, doc) {
return true;
},
update: function (userId, docs, fields, modifier) {
return true;
},
remove: function (userId, docs) {
return true;
LOAD CSV WITH HEADERS FROM "https://gist.githubusercontent.com/Spanarchie/b736661cf513f5bcf11b/raw/a84339c9b1d041703a7ba342bd58ad732797c61a/Proper%20GDP%20data" AS csvLine
return csvLine
@lvbreda
lvbreda / designer.html
Last active August 29, 2015 14:12
designer
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;