- 🎨 when improving the format/structure of the code
- 🚀 when improving performance
- ✏️ when writing docs
- 💡 new idea
- 🚧 work in progress
- ➕ when adding feature
- ➖ when removing feature
- 🔈 when adding logging
- 🔇 when reducing logging
- 🐛 when fixing a bug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE OverloadedStrings #-} | |
-- This is a very simple example of parsing and generating json with Aeson, | |
-- by a haskell newbie and intended for newbies. | |
-- | |
-- This almost certainly contains a number of bad practices. It works for | |
-- me and hopefully will get you started. | |
-- | |
-- I couldn't find a stand-alone example of Aeson usage and found it tricky to | |
-- get going. For example, if you don't realize to enable the language extension |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
"""Print a swatch using all 256 colors of 256-color-capable terminals.""" | |
__author__ = "Marius Gedminas <marius@gedmin.as>" | |
__url__ = "https://gist.github.com/mgedmin/2762225" | |
__version__ = '2.0' | |
def hrun(start, width, padding=0): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from math import sqrt | |
class Point: | |
def __init__(self,x_init,y_init): | |
self.x = x_init | |
self.y = y_init | |
def shift(self, x, y): | |
self.x += x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import turtle | |
import math | |
def lerp(a, b, t): | |
"""Linear interpolation function. returns a when t==0, returns b when t==1 | |
and linearly interpolates for values inbetween""" | |
return (a * (1 - t)) + (b * t) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##----GIT------ | |
alias gs='clear ;and git status' | |
alias gb='git branch' | |
alias gbranch='git rev-parse --abbrev-ref HEAD' #get current branch name | |
alias gl="clear ;and git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit" | |
alias gt='git tag' | |
alias grm='git rm' | |
alias gps='git push' | |
alias gbi='git bisect' | |
alias gbg='git bisect good' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 "Once you have their money, you never give it back." "The Nagus" (DS9 episode) | |
2 "The best deal is the one that makes the most profit." The 34th Rule (DS9 novel) | |
3 "Never spend more for an acquisition than you have to." "The Maquis, Part II" (DS9 episode) | |
4 "A woman wearing clothes is like a man in the kitchen." The Ferengi Rules of Acquisition (DS9 novel) | |
5 "Always exaggerate your estimates." Cold Fusion (SCE novel) | |
6 "Never let family stand in the way of opportunity." "The Nagus" (DS9 episode) | |
7 "Always keep your ears open." "In the Hands of the Prophets" (DS9 episode) | |
8 "Small print leads to large risk." The Ferengi Rules of Acquisition (DS9 novel) | |
9 "Instinct, plus opportunity, equals profit." "The Storyteller" (DS9 episode) | |
10 "Greed is eternal." "Prophet Motive" (VOY episode) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
from fontTools.misc.py23 import * | |
from fontTools.ttLib import TTFont | |
import sys | |
import argparse | |
parser = argparse.ArgumentParser(description="OpenType Variation Instance Generator") | |
parser.add_argument('font', help="font file") | |
parser.add_argument('-a', '--all', action="store_true", help="Generate all instances") | |
parser.add_argument('-o', '--output', help="Output directory", default = ".") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## Quick script to mention how many bikes are available near $EMPLOYER | |
## Will also show how many bike racks are available near PABT | |
## relies on curl and jq | |
## curl: https://curl.haxx.se/ | |
## jq: https://stedolan.github.io/jq/ | |
URL="https://feeds.citibikenyc.com/stations/stations.json" | |
JSON="/tmp/citibike.json" |
I wrote this answer on stackexchange, here: https://stackoverflow.com/posts/12597919/
It was wrongly deleted for containing "proprietary information" years later. I think that's bullshit so I am posting it here. Come at me.
Amazon is a SOA system with 100s of services (or so says Amazon Chief Technology Officer Werner Vogels). How do they handle build and release?
OlderNewer