Skip to content

Instantly share code, notes, and snippets.

View timoweiss's full-sized avatar

Timo Weiß timoweiss

View GitHub Profile
/**
graphql sample query:
{
event(eventId: "123") {
days
eventItems {
id
day
}
}
{
"name": "xframeserver",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
{
"name": "proxy",
"version": "1.0.0",
"description": "",
"main": "server.js",
"author": "",
"license": "ISC",
"dependencies": {
"h2o2": "^7.0.0",
"hapi": "^17.1.1"
@timoweiss
timoweiss / seneca.js
Last active September 21, 2017 13:13
seneca
seneca.act('role:users,cmd:login,email:abc@abc.de,password:secret');
seneca.act('role:users,cmd:login', { email: 'abc@abc.de', password: 'secret' });
seneca.act({ role: 'users', cmd: 'login' }, { email: 'abc@abc.de', password: 'secret' })
seneca.act({}, { role: 'users', cmd: 'login', email: 'abc@abc.de', password: 'secret' });

Keybase proof

I hereby claim:

  • I am timoweiss on github.
  • I am timoweiss (https://keybase.io/timoweiss) on keybase.
  • I have a public key whose fingerprint is 3E44 CCE1 164B AE26 1882 F876 127F F448 A7C8 0168

To claim this, I am signing this object:

<link rel="import" href="../core-animated-pages/core-animated-pages.html">
<link rel="import" href="../core-animated-pages/transitions/hero-transition.html">
<link rel="import" href="../core-animated-pages/transitions/cross-fade.html">
<link rel="import" href="../core-animated-pages/transitions/slide-down.html">
<link rel="import" href="../core-animated-pages/transitions/slide-up.html">
<link rel="import" href="../core-animated-pages/transitions/tile-cascade.html">
<link rel="import" href="../core-drawer-panel/core-drawer-panel.html">
<link rel="import" href="../core-field/core-field.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-input/core-input.html">
@timoweiss
timoweiss / gist:11398251
Created April 29, 2014 12:06
get unique array
var getUniqueArray = function(arr) {
return arr.reduce(function(p, c) {
if (p.indexOf(c) < 0) p.push(c);
return p;
}, []);
}
@timoweiss
timoweiss / gist:10714191
Last active August 29, 2015 13:59
~ tilde shortcut | is it in the array?
//~ is a bitwise NOT operator, which will return 0 only for -1.
// check http://stackoverflow.com/questions/18347033/how-to-shorten-my-conditional-statements/18347047#answer-18347047
var test = { type: 3 };
if ( ~[1, 2, 3, 4].indexOf(test.type) ) {
alert('woohooo!');
}