Skip to content

Instantly share code, notes, and snippets.

View Miserlou's full-sized avatar

Rich Jones Miserlou

View GitHub Profile
@Miserlou
Miserlou / gist:11500b2345d3fe850c92
Created April 27, 2015 21:20
1000 Largest US Cities By Population
Largest 1000 Cities in America
2013 popuation data - Biggest US Cities By Population
rank,city,state,population,2000-2013 growth
1,New York,New York,8405837,4.8%
2,Los Angeles,California,3884307,4.8%
3,Chicago,Illinois,2718782,-6.1%
4,Houston,Texas,2195914,11.0%
5,Philadelphia,Pennsylvania,1553165,2.6%
@Miserlou
Miserlou / cities.json
Created April 30, 2015 06:58
1000 Largest US Cities By Population With Geographic Coordinates, in JSON
[
{
"city": "New York",
"growth_from_2000_to_2013": "4.8%",
"latitude": 40.7127837,
"longitude": -74.0059413,
"population": "8405837",
"rank": "1",
"state": "New York"
},
@Miserlou
Miserlou / flask_binary.py
Created February 17, 2017 19:07
Flask serving binary data example
import io
from flask import Flask, send_file
app = Flask(__name__)
@app.route('/logo.jpg')
def logo():
"""Serves the logo image."""
with open("logo.jpg", 'rb') as bites:
@Miserlou
Miserlou / geo_platform_stats.json
Created May 8, 2018 20:58
geo_platform_stats.json
This file has been truncated, but you can view the full file.
[
{
"gpl": "GPL570",
"num_samples": 137981,
"title": "[HG-U133_Plus_2] Affymetrix Human Genome U133 Plus 2.0 Array"
},
{
"gpl": "GPL13112",
"num_samples": 99869,
"title": "Illumina HiSeq 2000 (Mus musculus)"
@Miserlou
Miserlou / light.html.heex
Created February 20, 2023 12:45
Heex Example
<h1>The light is <%= @bulb_status %>.</h1>
<button phx-click="on" disabled={!@bulb_on} >On</button>
<button phx-click="off" disabled={@bulb_on}>Off</button>
@Miserlou
Miserlou / semantic-2.2.9.html
Created March 4, 2017 00:46
Semantic UI 2.2.9 CDN Starter
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8" />
<title>Semantic UI CDN</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.9/semantic.min.css"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.9/semantic.min.js"></script>
</head>
<body>
@Miserlou
Miserlou / sort_map_by_value_example.ex
Last active May 12, 2022 13:48
How to Sort a Map By Value In Elixir
# I couldn't find this easily in the documentation or on Google.
# Here's how you sort a map in Elixir.
# Maps aren't a sorted structure, so the result is a keyword list.
input = %{
player_1: %{score: 2},
player_2: %{score: 1},
player_3: %{score: 10}
player_4: %{score: 5}
}
@Miserlou
Miserlou / shell_invoke.sh
Created August 31, 2017 20:00
Execute Lambda Shell Commands With Zappa
zappa invoke --raw 'import subprocess; print subprocess.check_output("ls");'
@Miserlou
Miserlou / heatmap.py
Created February 15, 2019 19:52
Heatmaps with Dask, Holoviews and Datashader
import time
import datashader as ds
import pandas as pd
import numpy as np
import holoviews as hv
from holoviews import opts
from colorcet import fire
from datashader import transfer_functions as tf
from dask import dataframe as dd
@Miserlou
Miserlou / geo_platforms_with_organism.json
Created May 9, 2018 14:43
geo_platforms_with_organism.json
This file has been truncated, but you can view the full file.
[
{
"gpl": "GPL570",
"num_samples": 137985,
"organism": "Homo sapiens",
"title": "[HG-U133_Plus_2] Affymetrix Human Genome U133 Plus 2.0 Array"
},
{
"gpl": "GPL13112",
"num_samples": 99869,