Skip to content

Instantly share code, notes, and snippets.

View xguse's full-sized avatar

Gus Dunn xguse

View GitHub Profile
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: OpenPGP.js v.1.20130712
Comment: http://openpgpjs.org
xsBNBFINLngBCACTfqW1ZsIPtaBCeXGQ+KuG66wBCTVNodqhY5P292sekYOG
1ldjADX1bO/T88nqQlBgJi/gwzOb9dDkD/MXjcdX3buJS+oiPsHdG9+v34Xq
owZCbZP4XAHC3epXkpN/K/kMdjY5mPorakeP4eXWKT3XfKwhe/GoZ3eXcxaH
tfGIK1M055fBCQIuOusgMf55dbsfg9QyzTbXZciP0x9PuUvrd3TaYpebBmYq
cTc0Z44feQevj+/GQxh8Il4i+eJF1mpa1gzVbAKfnAXu1zxqOuHIwfbaKlgM
f32fXFC17ya/2ZQ7wkme/E2XOTrSjuSYLj5hewDccYat+T9dtaZRfFWjABEB
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG/MacGPG2 v2.0.20 (Darwin)
Comment: GPGTools - https://gpgtools.org
mQINBFIKB18BEADWZvUf+2taIgGEl+AbZVOEuPt1movmT2KG9qY0354RS4EVJU+s
3edCSm55ynazcJo6ikSEsVFb2LKa9Lmqpf//32Q3Mpt10AX7nLcnxYBrMCu6uVBV
l+9cpPKIFtOLLZQvLN4LhgS39wAi+Azin3on3LrTWc7knRwCeGrx+UupbDdYiExm
sVleD9gjKX9ri/sqEdBlNZV48pXrCGbEC3b50Jh1rdPIUg//KZMAwThuOzXo2Y8l
9pWLWZqbuNXCBNDixq3TVOZAptWrvSSCQDrfA+wJbho9dRR3jurgoF9kb8BiJnsL
CZkf2R8tMUfgG866okRisRCIE8VbRX19bS6is0czKa/1/HJc0NDhLV4hig2aijsP
@xguse
xguse / noise.sh
Last active November 21, 2022 12:14 — forked from rsvp/noise.sh
#!/usr/bin/env bash
# bash 4.1.5(1) Linux Ubuntu 10.04 Date : 2011-10-04
#
# _______________| noise : ambient Brown noise generator (cf. white noise).
#
# Usage: noise [minutes=59] [band-pass freq center=1786] [wave]
# ^minutes can be any positive integer.
# Command "noise 1" will display peak-level meter.
#
# Dependencies: play (from sox package)
@xguse
xguse / 0_reuse_code.js
Created February 2, 2014 23:14
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@xguse
xguse / flask-upload
Last active August 29, 2015 14:06 — forked from dAnjou/flask-upload
<VirtualHost *>
ServerName example.com
WSGIDaemonProcess www user=max group=max threads=5
WSGIScriptAlias / /home/max/Projekte/flask-upload/flask-upload.wsgi
<Directory /home/max/Projekte/flask-upload>
WSGIProcessGroup www
WSGIApplicationGroup %{GLOBAL}
Order deny,allow
@xguse
xguse / Backend.py
Last active August 29, 2015 14:07 — forked from bpeck/Backend.py
import multiprocessing
import multiprocessing.queues
from flask import Flask
from flask import request
class Backend(object):
def __init__(self, command_queue, host='0.0.0.0', port=8000, debug=True):
self.command_queue = command_queue
self.flask_app = Flask('Backend')
self.flask_app.add_url_rule('/', "handleRequest", self.handleRequest, methods=['GET'])
# Ensure we're in a virtualenv.
if [ "$VIRTUAL_ENV" == "" ]
then
echo "ERROR: not in a virtual environment."
exit -1
fi
# Setup variables.
CACHE="/tmp/install-pygtk-$$"
@xguse
xguse / clip_magic.py
Last active August 29, 2015 14:15 — forked from nova77/clip_magic.py
Add copy to clipboard from IPython!
"""
Add copy to clipboard from IPython!
To install, just copy it to your profile/startup directory, typically:
~/.ipython/profile_default/startup/
Example usage:
%clip hello world
# will store "hello world"

Having trouble installing the latest stable version of tmux?

I know, official package for your OS/distro is outdated and you just want the newest version of tmux.

Well, this script should save you some time with that.

Prerequisities

  • gcc
@xguse
xguse / PKGBUILD
Last active August 29, 2015 14:24 — forked from flying-sheep/PKGBUILD
# Maintainer: Meow < a.li.devtty at gmail dot com >
# Get download links and md5 sums for latest version of RStudio desktop
cat <<_EOF_ >/dev/null
## R code #############
require(XML)
page = htmlTreeParse("http://www.rstudio.com/products/rstudio/download/",useInternalNodes = T)
links = sapply(getNodeSet(page,'//table[@class="downloads"]/thead/tr/th[text()="Installers"]/../../..//a[contains(@href,".deb")]'),xmlGetAttr,'href')
md5sums = sapply(getNodeSet(page,'//table[@class="downloads"]/thead/tr/th[text()="Installers"]/../../..//a[contains(@href,".deb")]/../..//code'),xmlValue)
print(cbind(links,md5sums))