Skip to content

Instantly share code, notes, and snippets.

View dsibilly's full-sized avatar

Duane Sibilly dsibilly

View GitHub Profile
#!/usr/bin/env bash
USER_DIR=/home/steam
ARK_DIR=$USER_DIR/Ark1
SAVE_DIR=$USER_DIR/Ark1/ShooterGame/Saved
STEAMCMD=./steamcmd.sh
STEAMCMD_DIR=$USER_DIR/steamcmd
TEMP_DIR=$USER_DIR/Saved
mv $SAVE_DIR $TEMP_DIR
@dsibilly
dsibilly / destinyCodes.js
Last active August 29, 2015 14:06
Automatically redeem known codes for Bungie's Destiny
/**
* destinyCodes.js
* Automatically redeem known codes for Bungie's Destiny
* Duane Sibilly <duane@sibilly.com>
*
* USAGE: Login to your account on bungie.net, and navigate to the code
* redemption page at http://www.bungie.net/en/User/coderedemption. Open your
* browser's JavaScript console (Chrome: Ctrl-Shift-J), and paste the contents
* of this file into the console. Hit enter. You can safely ignore the alert
* message that pops up for any codes you've already redeemed.
@dsibilly
dsibilly / niceLog.py
Last active August 29, 2015 14:06
Print line numbers and time in Python 3
#!/usr/bin/env python3
from datetime import datetime
from inspect import currentframe, getframeinfo
def niceLog(msg):
frameinfo = getframeinfo(currentframe().f_back)
print(" ".join([frameinfo.filename, "Line", str(frameinfo.lineno), datetime.now().strftime("%Y-%m-%d %H:%M:%S"), msg]))
@dsibilly
dsibilly / related_models.py
Created May 11, 2011 20:31
SQLAlchemy related models demo
@dsibilly
dsibilly / xcode4_build.py
Created June 8, 2011 19:37
Unique Build Numbers for XCode 4
# XCode 4 auto-versioning script for Git
# Inspired by the work of Axel Andersson, Marcus S. Zarra and Matt Long
# http://valthonis.net/u/19
"""
NOTE: Due to its use of build environment variables, this
script will only work from inside XCode's build process!
"""
import os
@dsibilly
dsibilly / Bcrypt.php
Created June 29, 2011 17:01
Simple PHP 5.3+ Bcrypt class adapted from phpass
<?php
/*
Adaptation by Marco Arment <me@marco.org>.
Adapted from Portable PHP Password Hashing Framework (phpass) version 0.3:
http://www.openwall.com/phpass/
phpass was by Solar Designer <solar at openwall.com> in 2004-2006 and is in
the public domain. This adaptation is also in the public domain.
@dsibilly
dsibilly / imgur_downloader.py
Last active October 3, 2015 06:37
Threaded Imgur Album Download Script
#!/usr/bin/env python
# Imgur Album Downloader
# Version 20121015-01
#
# THIS SCRIPT NO LONGER WORKS AGAINST THE CURRENT IMGUR WEBSITE
# DO NOT USE! THIS GIST IS HERE FOR POSTERITY ONLY!
#
# Now with multithreading!
# Just paste the URL of an Imgur album/gallery/subdomain
# at the prompt, and away you go!
@dsibilly
dsibilly / api.js
Created June 30, 2012 04:25 — forked from fwielstra/api.js
An example NodeJS / Mongoose / Express application based on their respective tutorials
/* The API controller
Exports 3 methods:
* post - Creates a new thread
* list - Returns a list of threads
* show - Displays a thread and its posts
*/
var Thread = require('../models/thread.js');
var Post = require('../models/post.js');
@dsibilly
dsibilly / gist:3036625
Created July 3, 2012 00:30
Add git branch info to your prompt (only in git-controlled directories!)
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working direct
ory clean)" ]] && echo "*"
}
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(par
se_git_dirty)]/"
}
@dsibilly
dsibilly / 4e-xp.js
Created May 25, 2012 13:24
D&D 4th Edition Encounter Level Calculator
/**
* 4e-xp.js
* D&D 4th Edition Encounter Level Calculator
*
* Copyright (C) 2012 Duane Sibilly <duane@sibilly.com>
*
* 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