Skip to content

Instantly share code, notes, and snippets.

View craigcalef's full-sized avatar
💭
It is by my will alone that I set my mind in motion.

Craig Calef craigcalef

💭
It is by my will alone that I set my mind in motion.
View GitHub Profile
@protocool
protocool / caveatPatchor.js
Created February 14, 2011 02:29
Sample caveatPatchor.js file for use in Propane 1.1.2 and above
/*
As of version 1.1.2, Propane will load and execute the contents of
~Library/Application Support/Propane/unsupported/caveatPatchor.js
immediately following the execution of its own enhancer.js file.
You can use this mechanism to add your own customizations to Campfire
in Propane.
Below you'll find two customization examples.
@craigcalef
craigcalef / exception_printer.py
Created February 22, 2012 04:36
Exception printing decorator
import traceback
def printexceptions(f):
def a(*args, **kwargs):
try:
return f(*args, **kwargs)
except:
traceback.print_exc()
return a
@psobot
psobot / lame.py
Created April 14, 2012 19:34
Asynchronous MP3 encoding in Python
from Queue import Queue
import subprocess
import threading
import traceback
import logging
import time
log = logging.getLogger(__name__)
"""
docker:
pkgrepo.managed:
- humanname: Docker Inc. PPA
- name: deb http://get.docker.io/ubuntu docker main
- comments:
- "# Docker Inc. Repo"
- key_url: https://get.docker.io/gpg
# - require_in:
# - pkg: lxc-docker
pkg.installed:
@jbinto
jbinto / howto-recover-google-authenticator-keys.txt
Created February 8, 2014 04:20
Recovering Google Authenticator keys from Android device for backup
### Last tested February 7 2014 on a Galaxy S3 (d2att) running Cyanogenmod 11 nightly, with Google Authenticator 2.49.
### Device with Google Authenticator must have root.
### Computer requires Android Developer Tools and SQLite 3.
### Connect your device in USB debugging mode.
$ cd /tmp
$ adb root
$ adb pull /data/data/com.google.android.apps.authenticator2/databases/databases
@meub
meub / gist:cc4fe3e0d4269efb8569c7ce70a2addd
Last active April 12, 2024 19:38
Scrape ReserveAmerica for Available Campsites
import os, sys, re, io, json, time
import mechanize
import pytz
import smtplib
import bs4
from datetime import datetime, timedelta
from pytz import timezone
from bs4 import BeautifulSoup
from email.mime.text import MIMEText
@alsmola
alsmola / cloudtrail_partition_create_athena_table.sql
Last active August 23, 2023 10:28
cloudtrail_partition_create_athena_table
CREATE EXTERNAL TABLE cloudtrail_logs (
eventversion STRING,
userIdentity STRUCT<
  type:STRING,
  principalid:STRING,
  arn:STRING,
  accountid:STRING,
  invokedby:STRING,
  accesskeyid:STRING,
userName:STRING,
@jalaziz
jalaziz / 999-aws-ebs-nvme.rules
Last active May 21, 2024 01:37
CoreOS AWS EBS NVMe udev rules
# Copyright (C) 2018 Jameel Al-Aziz
# Modified for simplicification and use within CoreOS.
#
# Copyright (C) 2006-2016 Amazon.com, Inc. or its affiliates.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
import requests
import praw
import logging
import time
import random
import schedule
import pickle
import sys
from datetime import datetime, timedelta
import matplotlib.pyplot as plt
from PyQt5 import QtCore
import numpy as np
import time
import math
class VisualiseFrequency(QtCore.QThread):
def __init__(self, song, canvas, player):