Skip to content

Instantly share code, notes, and snippets.

View maggiben's full-sized avatar

Benjamin maggiben

  • Frávega
  • Argentina
View GitHub Profile
@maggiben
maggiben / searcher.js
Created July 19, 2015 07:59
A Reactive autocomplete for Aurelia
import {inject, customAttribute, bindable} from 'aurelia-framework';
import {HttpClient} from 'aurelia-http-client';
import typeahead from 'typeahead';
import Rx from 'rx';
import 'styles/type-ahead.css!'
@inject(Element, HttpClient)
@bindable("value")
@customAttribute('searcher')
export class Searcher {
$data = array(
'interval' => strtotime( $data[1]->date ) - strtotime( $data[0]->date ),
'data' => $values,
'units' => $unit['unit'],
'start' => strtotime( $data[0]->date ),
'end' => strtotime( $to ),
'name' => $entity['name'],
'metric' => $metric['name'],
'source' => $entity['data']['source']['name'],
'observation_start' => $entity['data']['observation_start']
$unit = $this->get_mapped_unit( $entity['data']['units'] );
$values = array_map( function($v) use ($unit) {
if (strcmp($v, ".") !== 0) {
return $v * $unit['multiplier'];
} else {
return null;
}
}, wp_list_pluck( $data, 'value' ) );
// Homepage Symbols
.featured-symbols
list-style: none
display: flex
padding: 0px
margin: 0px
justify-content: space-between
border-bottom: 1px solid #c9c8c9
h1, h2, h3, h4, h5, h6
font-family: "Roboto", sans-serif !important
<ul class="featured-symbols">
<li class="featured-symbol" data-symbol="msa">
<h5 class="symbol-source">S&P 500 <span class="timestamp">3:42 PM (EST)</span></h5>
<h4 class="symbol-price up" data-unit="$ & cents" data-quotes="Last">$115.33</h4>
<h5 class="small-numbers"><span class="symbol-change" data-unit="$ & cents" data-quotes="Change">$1.14</span> (<span class="percentage" data-quotes="PercentChange"></span>)</h5>
</li>
<li class="featured-symbol" data-symbol="aapl">
<h5 class="symbol-source">S&P 500 <span class="timestamp">3:42 PM (EST)</span></h5>
<h4 class="symbol-price up" data-unit="$ & cents" data-quotes="Last">$115.33</h4>
<h5 class="small-numbers"><span class="symbol-change" data-unit="$ & cents" data-quotes="Change">$1.14</span> (<span class="percentage" data-quotes="PercentChange"></span>%)</h5>
{
status: "success",
code: 0,
host: "coreapp-ngapi-prod-2c0bfa9c",
generated_at: "Fri, 06 Nov 2015 19:41:14 +0000",
message: "ok",
data: {
pins: [{
domain: "easyrideme.tumblr.com",
attribution: null,
function download(filename, text) {
var pom = document.createElement('a');
pom.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text));
pom.setAttribute('download', filename);
if (document.createEvent) {
var event = document.createEvent('MouseEvents');
event.initEvent('click', true, true);
pom.dispatchEvent(event);

Aurelia-Node

This is a NodeJS Express App bundled with the Skeleton App of the Aurelia platform. It sets up a standard navigation-style app using gulp to build your ES6 code with the babel compiler. Karma/Jasmine testing is also configured.

For more info please visit the official site: http://www.aurelia.io/

Running The App

  1. Fork or download this repo
@maggiben
maggiben / typeahead.html
Created January 25, 2016 08:40
Aurelia typeahead
<template>
<require from="/styles/type-ahead.css"></require>
<div class="ui icon input">
<input type="text" class="form-control" placeholder.bind="options.placeholder" value.bind="value">
<i class="search link icon"></i>
</div>
</template>
@maggiben
maggiben / index.html
Created November 24, 2016 09:04
3D World (with THREE)
<!DOCTYPE html>
<script src='http://cdnjs.cloudflare.com/ajax/libs/three.js/r82/three.min.js'></script>
<script src='http://cdnjs.cloudflare.com/ajax/libs/stats.js/r14/Stats.min.js'></script>
<script src='http://cdnjs.cloudflare.com/ajax/libs/dat-gui/0.5/dat.gui.min.js'></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/tween.js/16.3.5/Tween.min.js"></script>
<script src='orbit.js'></script>
<script>
</script>