Skip to content

Instantly share code, notes, and snippets.

@sloria
sloria / bobp-python.md
Last active May 1, 2024 08:37
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@eerohele
eerohele / mosh-cygwin.md
Last active March 3, 2024 04:20
Compiling Mosh (http://mosh.mit.edu/) under Cygwin

NOTE: You don't need to compile Mosh on Cygwin yourself anymore; just install the package with Cygwin's setup.exe.

  1. Download Cygwin.

  2. Run setup.exe and install the following packages in addition to the default ones:

    • make
    • boost
    • libncurses-devel
    • pkg-config
  • perl
@max-mapper
max-mapper / 0.md
Last active February 25, 2024 12:24
JS hoisting by example

JavaScript function hoisting by example

Below are many examples of function hoisting behavior in JavaScript. Ones marked as works successfuly print 'hi!' without errors.

To play around with these examples (recommended) clone them with git and execute them with e.g. node a.js

Notes on hoisting

(I may be using incorrect terms below, please forgive me)

@max-mapper
max-mapper / readme.md
Last active March 16, 2023 15:18
Video stabilization using VidStab and FFMPEG (Mac OS X)

Video stabilization using VidStab and FFMPEG

Examples here use the default settings, see the VidStab readme on GitHub for more advanced instructions.

Here's an example video I made

Install ffmpeg with the vidstab plugin from homebrew

brew install ffmpeg --with-libvidstab
@tomysmile
tomysmile / mac-php-composer-setup.md
Created July 11, 2016 10:45
Setup PHP Composer using Brew
@hoffrocket
hoffrocket / parhttp.py
Created August 28, 2012 00:29
Python parallel http requests using multiprocessing
#!/usr/bin/env python
from multiprocessing import Process, Pool
import time
import urllib2
def millis():
return int(round(time.time() * 1000))
def http_get(url):
@gl-sergei
gl-sergei / inbox.el
Last active December 21, 2022 21:38
Display number of unread messages in Emacs modeline (with mu and mu4e)
;;; inbox.el --- display inbox status information -*- coding: utf-8 -*-
;; Copyright (C) 2014 Sergei Glushchenko.
;; Author: Sergei Glushchenko <gl.sergei@gmail.com>
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
# Gist example of IB wrapper ...
#
# Download API from http://interactivebrokers.github.io/#
#
# Install python API code /IBJts/source/pythonclient $ python3 setup.py install
#
# Note: The test cases, and the documentation refer to a python package called IBApi,
# but the actual package is called ibapi. Go figure.
#
# Get the latest version of the gateway:
@masaedw
masaedw / emacs.sh
Created January 6, 2012 16:27
run emacs.app or emacsclient on Mac OS X
function e() {
if [ -z `pgrep Emacs` ]; then
env LANG=C open -a Emacs "$@"
return
fi
local client="/Applications/MacPorts/Emacs.app/Contents/MacOS/bin/emacsclient"
local uid=`id -u`
local socket="$TMPDIR"/emacs"$uid"/server
@philc
philc / init.lua
Created October 13, 2017 18:43
My hammerspoon config
-----------------------------------------------------------------------
-- References:
-- https://github.com/apesic/dotfiles/blob/master/.hammerspoon/init.lua
-- https://learnxinyminutes.com/docs/lua/
-----------------------------------------------------------------------
----------------
-- Configuration
----------------