Skip to content

Instantly share code, notes, and snippets.

View elmariachi111's full-sized avatar
🦄
meow

Stefan Adolf elmariachi111

🦄
meow
View GitHub Profile
@elmariachi111
elmariachi111 / gist:5519031
Created May 4, 2013 22:48
Rendering Heatmaps in GMaps
var brazil = new google.maps.LatLng(-18.771115, -42.758789);
map = new google.maps.Map(document.getElementById('map-canvas'), {
center: brazil,
zoom: 5,
mapTypeId: google.maps.MapTypeId.ROADMAP
});
layer = new google.maps.FusionTablesLayer({
query: {
@elmariachi111
elmariachi111 / gist:5524959
Created May 6, 2013 13:02
An SQL query that JOINs GTFS relational data into something more friendly for JSON transformation
USE hack_test;
SELECT DISTINCT
s.stop_id, s.stop_sequence, s.pickup_type, s.drop_off_type, t.route_id,
t.trip_headsign, r.route_short_name,r.agency_id, st.stop_name,
st.stop_lat, st.stop_lon
FROM stop_times s LEFT JOIN trips t ON s.trip_id = t.trip_id
LEFT JOIN routes r ON t.route_id = r.route_id
LEFT JOIN stops st ON s.stop_id = st.stop_id;
@elmariachi111
elmariachi111 / Main.js
Created July 1, 2013 21:53
A Backbone practice to load many remote templates asynchronously and start rendering after all have been loaded
//require NRD.js somewhere...
var models = new Backbone.Collection([ 
new NRD.Model({type: 'image'}),
new NRD.Model({type: 'tweet'})
]);
var masterView = new NRD.View(collection);
masterView.loadTemplates ( function () {
masterView.render();
@elmariachi111
elmariachi111 / head.html
Created July 6, 2013 22:29
made with requirebin.com
<style type='text/css'> html, body { margin: 0; padding: 0; border: 0; } </style>
@elmariachi111
elmariachi111 / feigenbaum.go
Last active July 28, 2017 09:09
Feigenbaum's bifurcation diagram in Go
package main
import (
"image"
"os"
"image/png"
"image/color"
"image/draw"
"runtime"
)
@elmariachi111
elmariachi111 / AcmeMemcached.php
Last active September 12, 2017 15:32
Symfony2 Memcached settings for persistent connections
<?php
namespace Acme\CoreBundle\Classes\Cache;
class AcmeMemcached extends \Memcached {
function __construct($persistent_id)
{
@elmariachi111
elmariachi111 / README.md
Last active January 4, 2018 14:10
Cryptocurrency Exchange tickers using ccxt

Cryptocurrency Exchange tickers using ccxt

queries tickers from various cryptocurrency exchanges. See https://github.com/ccxt/ccxt for all resources

┌───────────────┬───────────────┬───────────────┬──────────────┬───────────────┐
│ Exchange      │ BTC/EUR       │ ETH/EUR       │ LTC/EUR      │ XMR/EUR       │
├───────────────┼───────────────┼───────────────┼──────────────┼───────────────┤
│ coinmarketcap │ 12150.4880623 │ 817.591620461 │ 193.38186035 │ 326.259801595 │
├───────────────┼───────────────┼───────────────┼──────────────┼───────────────┤
@elmariachi111
elmariachi111 / seed.js
Created January 28, 2018 21:44
create a iota seed in plain js
function createSeed(){
const seedsize = 81;
const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ9";
let seed = "";
for (var i = 0, n = chars.length; i < seedsize; ++i) {
seed += chars.charAt(Math.floor(Math.random() * n));
}
return seed;
}
Verifying my Blockstack ID is secured with the address 1N9A6gny5PTDiZ1JYZbWbgAskSWTyMuvS7 https://explorer.blockstack.org/address/1N9A6gny5PTDiZ1JYZbWbgAskSWTyMuvS7
Verifying my Blockstack ID is secured with the address 1N9A6gny5PTDiZ1JYZbWbgAskSWTyMuvS7 https://explorer.blockstack.org/address/1N9A6gny5PTDiZ1JYZbWbgAskSWTyMuvS7