Skip to content

Instantly share code, notes, and snippets.

@schlamar
schlamar / example.py
Last active February 13, 2022 18:15
mplog: Python advanced multiprocessing logging.
import logging
import multiprocessing
import time
import mplog
FORMAT = '%(asctime)s - %(processName)s - %(levelname)s - %(message)s'
logging.basicConfig(level=logging.DEBUG, format=FORMAT)
existing_logger = logging.getLogger('x')

Falsehoods programmers believe about prices

  1. You can store a price in a floating point variable.
  2. All currencies are subdivided in 1/100th units (like US dollar/cents, euro/eurocents etc.).
  3. All currencies are subdivided in decimal units (like dinar/fils)
  4. All currencies currently in circulation are subdivided in decimal units. (to exclude shillings, pennies) (counter-example: MGA)
  5. All currencies are subdivided. (counter-examples: KRW, COP, JPY... Or subdivisions can be deprecated.)
  6. Prices can't have more precision than the smaller sub-unit of the currency. (e.g. gas prices)
  7. For any currency you can have a price of 1. (ZWL)
  8. Every country has its own currency. (EUR is the best example, but also Franc CFA, etc.)
@yanofsky
yanofsky / LICENSE
Last active June 5, 2024 21:51
A script to download all of a user's tweets into a csv
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
//
// WhereViewController.m
// WhereAmI
//
// Created by Kevin Whinnery on 4/8/13.
// Copyright (c) 2013 Kevin Whinnery. All rights reserved.
//
#import "WhereViewController.h"
@kentbye
kentbye / app-store-ratings.php
Created September 17, 2012 23:15 — forked from sgmurphy/podcast-ratings.php
Scrape iOS app review data from iTunes
<?php
/**
* Scrape the number of app reviews from iTunes.
*
* Set the iOS app id and the number of pages to scrape, and it creates a {$app_id}-reviews.csv file
*
* @author Kent Bye <kent@kentbye.com>
* Modified and extended from Sean Murphy's gist at https://gist.github.com/1878352
*/
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 4, 2024 06:56
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@sgmurphy
sgmurphy / podcast-ratings.php
Created February 21, 2012 19:31
Scrape ratings from iTunes store
<?php
/**
* Scrape the number of podcast reviews from iTunes for all country specific storefronts.
*
* @author Sean Murphy <sean@iamseanmurphy.com>
*/
$podcast_id = '366931951'; // Startups For the Rest of Us
//$podcast_id = '318567721'; // techzing
@grosser
grosser / Readme.md
Created September 10, 2011 12:38
Most recommended games on Steam

Get the most recommended games from steam (because steam does not tell...) this is an example and no invitation to DDos steam ;)