Skip to content

Instantly share code, notes, and snippets.

View Miserlou's full-sized avatar

Rich Jones Miserlou

View GitHub Profile
@mboersma
mboersma / DockerMacClient.md
Last active May 26, 2017 06:43
Build Docker on Mac OS X and run it as a client connected to a Linux VM running the docker daemon.

Run Docker client on Mac OS X connected to a Linux VM

Official Mac Docker Binary!

None of this is really necessary now that the Docker team is releasing official Mac OS X binary builds. Please see moby/moby#3337 for details.

@nkrumm
nkrumm / aspera_to_s3.sh
Created December 23, 2013 07:14
DIY Direct-to-S3 Aspera solution. This snipped monitors a directory for new files (uploaded via aspera, for example) and then starts a background s3cmd job to upload those files Using the --partial-file-suffix=.part for the ascp command ensures that inotifywait only gets trigger when the file is finished uploading.
inotifywait -m -e moved_to $BASE | while read line
do
F=$(echo $line | cut -f3 -d" ")
echo "Now uploading $F"
s3cmd --force --no-progress put $F s3://mybucket/ &
done
@pinceladasdaweb
pinceladasdaweb / imgur.js
Created March 27, 2014 13:14
Upload images to imgur via JavaScript
/*
--------------------------------
imgur Upload
--------------------------------
+ https://github.com/pinceladasdaweb/imgur-upload
+ version 1.1
+ Copyright 2014 Pedro Rogerio
+ Licensed under the MIT license
+ Documentation: https://github.com/pinceladasdaweb/imgur-upload
@florianhartig
florianhartig / copyInstalledPackages.r
Last active June 15, 2022 08:29
Script to copy the packages installed on one computer or R version to another. Originally from http://stackoverflow.com/questions/1401904/painless-way-to-install-a-new-version-of-r-on-windows
# modified from http://stackoverflow.com/questions/1401904/painless-way-to-install-a-new-version-of-r-on-windows
# run on old computer / r version
setwd("/Users/Florian/Dropbox/temp") # or any other existing temp directory
packages <- installed.packages()[,"Package"]
save(packages, file="Rpackages")
# run on new computer / r version
setwd("/Users/Florian/Dropbox/temp") # or any other existing temp directory
@Kartones
Kartones / postgres-cheatsheet.md
Last active August 11, 2025 08:56
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@wkjagt
wkjagt / audio-book-reader.md
Last active April 12, 2024 14:18
How I built an audio book reader for my nearly blind grandfather

#How I built an audio book reader for my nearly blind grandfather

Tweet this - Follow me

Last year, when visiting my family back home in Holland, I also stopped by my grand-parents. My grand-father, now 93 years old, had always been a very active man. However, during the presceding couple of months, he'd gone almost completely blind and now spent his days sitting in a chair. Trying to think of something for him to do, I suggested he try out audio books. After finally convincing him -- he said audio books were for sad old people -- that listening to a well performed recording is actually a wonderful experience, I realized the problem of this idea.

####The problem with audio devices and the newly blind. After my first impulse to jump up and go buy him an

@jckantor
jckantor / NYSE_tradingdays.py
Last active February 9, 2023 13:22
Python dateutil rule sets for NYSE trading days and holiday observances.
from dateutil import rrule
import datetime
# Generate ruleset for holiday observances on the NYSE
def NYSE_holidays(a=datetime.date.today(), b=datetime.date.today()+datetime.timedelta(days=365)):
rs = rrule.rruleset()
# Include all potential holiday observances
rs.rrule(rrule.rrule(rrule.YEARLY, dtstart=a, until=b, bymonth=12, bymonthday=31, byweekday=rrule.FR)) # New Years Day
@rpgreen
rpgreen / gist:c127aa4ebbcaa9026be7
Last active March 10, 2023 02:10
Swagger file demonstrating two ways to achieve HTTP redirects using API Gateway and Lambda
---
swagger: "2.0"
basePath: "/test"
schemes:
- "https"
paths:
/lambdaredirect-default:
get:
produces:
- "application/json"
@Doerge
Doerge / test_app.py
Last active July 5, 2017 18:03
Basic app for testing flask-zappa functionality.
# -*- coding: utf-8 -*-
from flask import Flask, request, redirect, url_for, session, abort, current_app, json
app = Flask(__name__)
# This is the very unsecret key from the Flask-docs
app.secret_key = 'A0Zr98j/3yX R~XHH!jmN]LWX/,?RT'
@app.route('/')
@shihrer
shihrer / Packer.py
Last active October 8, 2021 17:57
Simple packing solution for Python. This is a python version of the algorithm located at http://codeincomplete.com/posts/2011/5/7/bin_packing/
"""
MIT License
Copyright (c) 2016 Michael Shihrer ([email protected])
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is