Skip to content

Instantly share code, notes, and snippets.

View maggiben's full-sized avatar

Benjamin maggiben

  • Frávega
  • Argentina
View GitHub Profile
<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>
// 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
$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' ) );
$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']
@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 {
{
"query":{
"count":41,
"created":"2013/12/02T13:09:27Z",
"lang":"en-US",
"results":{
"quote":[
{
"date":"2013/11/29",
"Date":"2013/11/29",
@maggiben
maggiben / malwares.json
Last active August 29, 2015 14:14
top malware threats
[
{
"avatar": "http://www.iconpng.com/png/windows8_icons2/biohazard.png",
"name": "bot cutwail",
"uname": "@cutwail",
"followers": "51904740",
"following": "134",
"tweets": "5456"
},
{
@maggiben
maggiben / countries-50m.json
Created December 1, 2014 14:23
countries-50m.json
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@maggiben
maggiben / world-100m.json
Created November 30, 2014 05:18
world-100m.json
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@maggiben
maggiben / world-110m.json
Created November 30, 2014 05:15
world-110m.json
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.