Skip to content

Instantly share code, notes, and snippets.

View idan's full-sized avatar
💫
Prototypin'

Idan Gazit idan

💫
Prototypin'
View GitHub Profile
import Fiona from "https://deno.land/x/fiona/deno/index.js";
import { csvFormat, csvParse } from "https://cdn.pika.dev/d3-dsv";
const { writeTextFile, run, mkdir, stdout } = Deno;
const { now } = performance;
type Row = {
name: string;
date: Date;
bio: string;
p: number;
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: artifact-passing-
spec:
entrypoint: artifact-example
templates:
- name: artifact-example
steps:
- - name: generate-artifact
@idan
idan / decaf_slack_theme.txt
Created April 23, 2020 15:55
Decaf Slack Theme
#2D2525,#221C1C,#221C1C,#FFCB58,#221C1C,#968A8B,#99DF66,#FF935B,#221C1C,#968A8B
@idan
idan / Hospital Modeling Data.md
Created March 27, 2020 01:09
Data for Modeling COVID Things

Model and Underlying Data

Data about Hospitals

Total number of beds by state draws upon aggregates from this report from ESRI based on Definitive Healthcare.

@idan
idan / gist:c27b2dd45a78273af848
Created October 8, 2014 13:13
Exploding Postgres HSTORE columns in Pandas
def explode_hstore(df, column):
"""Explode a column of a dataframe containing PostgreSQL hstore k-v pairs in the format of:
"foo"=>"bar", "baz"=>"quux", ...
Every key becomes a column. If a given row's pairs doesn't have a key, then the resulting column's value
will contain NaN.
"""
# split the tags column out as a new series, and break up each k=>v pair
s = df[column].str.split(', ').apply(pd.Series, 1).stack()
@idan
idan / gist:9596928
Created March 17, 2014 10:15
Python ISO week for date
import datetime
def week_for_date(target):
"""Given a target date, return a start and end for that date's ISO week.
The returned tuple includes two datetime.date's, (start, end):
start: midnight on the first day of the ISO week containing the target
end: midnight on the first day following the ISO week containing the target
Note that the end date represents the first date _not_ in the target week,
@idan
idan / gist:1385165
Created November 22, 2011 08:15
rel=logo enhancements
<!--
rel=logo is lovely.
I have a few ideas on making it better. The core idea is great, but if we're
pushing a new thing, we have an opportunity to encourage web developers to
provide more than just a single color logo. All of the ideas below are optional
enhancements for anybody wanting to use rel=logo on their site.
-->
@idan
idan / gfm.md
Created August 13, 2013 21:18
GFM Sample

GitHub Flavored Markdown

View the source of this content.

Let's get the whole "linebreak" thing out of the way. The next paragraph contains two phrases separated by a single newline character:

Roses are red Violets are blue

@idan
idan / simpleframeless.scss
Created January 11, 2012 10:49
My simplified take on Joni Korpi's Frameless
/*
Simplified Frameless
Based on Frameless by Joni Korpi <http://framelessgrid.com/>
licensed under CC0 <http://creativecommons.org/publicdomain/zero/1.0/>
*/
$font-size: 18; // Your base font-size in pixels
$em: $font-size; // Shorthand for outputting ems
$column: $font-size * 3; // The column-width of your grid in pixels