Skip to content

Instantly share code, notes, and snippets.

@abiosoft
abiosoft / Caddyfile
Created September 18, 2016 16:16
Caddy wordpress docker-compose
:80
root /usr/src/wordpress
gzip
fastcgi / wordpress:9000 php
rewrite {
if {path} not_match ^\/wp-admin
to {path} {path}/ /index.php?_url={uri}
}
log stdout
errors stderr
@disarticulate
disarticulate / angularjs_notebook.ipynb
Last active March 31, 2022 07:16
A notebook demonstrating how to use arbitrary frameworks (ie, AngularJS) within Jupyter Notebook
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@edsu
edsu / replies.py
Last active December 7, 2022 18:59
Try to get replies to a particular set of tweets, recursively.
#!/usr/bin/env python
"""
Twitter's API doesn't allow you to get replies to a particular tweet. Strange
but true. But you can use Twitter's Search API to search for tweets that are
directed at a particular user, and then search through the results to see if
any are replies to a given tweet. You probably are also interested in the
replies to any replies as well, so the process is recursive. The big caveat
here is that the search API only returns results for the last 7 days. So
@jamesvg
jamesvg / init.js
Last active September 1, 2016 16:09
jQuery(document).ready(function($){
var body = $(document.body);
body.on('click', 'a[rel~="external"], a[target="_blank"]', function(e) {
e.preventDefault();
var destination = window.open();
destination.opener = null;
destination.location = this.href;
return false;
});
});
@westurner
westurner / ordereddefaultdict.py
Created February 12, 2016 22:14
OrderedDefaultDict_.py
#!/usr/bin/env python
"""
ordereddefaultdict.OrderedDefaultDict
.. code:: bash
$ python ./ordereddefaultdict.py -t
$ nosetests ./ordereddefaultdict.py
$ py.test ./ordereddefaultdict.py
@winny-
winny- / gist:bb17853ffc76fbb9b039
Created November 13, 2015 01:38 — forked from nathanielc/gist:9b98350ccbcbf21256d7
Minecraft systemd unit file that uses tmux instead of screen
[root@plex ~]# cat /etc/systemd/system/minecraft@.service
[Unit]
Description=Minecraft Server %i
[Service]
WorkingDirectory=/opt/minecraft-%i
User=mcserver
Type=forking
ExecStart=/usr/bin/tmux new-session -s mc-%i -d '/bin/java -Xmx2048M -jar minecraft_server.jar nogui'
@malev
malev / Vagrantfile
Last active September 9, 2020 21:37
Vagrantfile: Ubuntu with miniconda 2 installed and working
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.network "private_network", ip: "192.168.33.10"
config.vm.provision "shell", inline: <<-SHELL
apt-get update -q
su - vagrant
wget -q https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh
chmod +x miniconda.sh
./miniconda.sh -b -p /home/vagrant/miniconda
echo 'export PATH="/home/vagrant/miniconda/bin:$PATH"' >> /home/vagrant/.bashrc
@audreyfeldroy
audreyfeldroy / pypi-release-checklist2.md
Last active March 9, 2020 19:26
My PyPI Release Checklist 2 (now with bumpversion)
  • Update HISTORY.rst
  • Commit the changes:
git add HISTORY.rst
git commit -m "Changelog for upcoming release 0.1.1."
  • Update version number (can also be patch or major)
bumpversion minor
#!/bin/sh
## newtab.sh -- newtab(), newwin() functions and osascripts for OSX Terminal
## src: https://stackoverflow.com/questions/7171725/open-new-terminal-tab-from-command-line-mac-os-x/12147804#12147804
## license: Creative Commons cc by-sa 3.0
function newtab {
# newtab() -- Open a new tab in the current Terminal window and
# optionally run a command.
# When invoked via a function named 'newwin', opens a new Terminal *window* instead.