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
'1033edge.com',
'11mail.com',
'123.com',
'123box.net',
'123india.com',
'123mail.cl',
'123qwe.co.uk',
'150ml.com',
'15meg4free.com',
'163.com',
@lvbreda
lvbreda / designer.html
Created December 31, 2014 10:15
designer
<link rel="import" href="../topeka-elements/category-icons.html">
<link rel="import" href="../core-icon/core-icon.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
@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%;
LOAD CSV WITH HEADERS FROM "https://gist.githubusercontent.com/Spanarchie/b736661cf513f5bcf11b/raw/a84339c9b1d041703a7ba342bd58ad732797c61a/Proper%20GDP%20data" AS csvLine
return csvLine
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;
@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();
@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 / 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>
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 / 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>");