Skip to content

Instantly share code, notes, and snippets.

@hastinbe
hastinbe / gist:6b0fe578585f55b1a16c
Created December 24, 2014 10:38
My color scheme for Terminator terminal emulator
# Color scheme configuration for Terminator terminal emulator (http://www.tenshu.net/terminator/ and https://launchpad.net/terminator)
#
# Copy the following lines within the [profiles] section of terminator configuration file at ~/.config/terminator/config
[[hastinbe]]
use_theme_colors = False
background_color = "#000000"
foreground_color = "#d9d9d9"
palette = "#000000:#cf3032:#32cf30:#cfcd30:#3032cf:#cd30cf:#30cfcd:#d9d9d9:#454545:#e28182:#82e281:#e2e081:#8182e2:#e081e2:#81e2e0:#ffffff"
@hastinbe
hastinbe / gist:ba2017eb39b0f2e6e01f
Last active August 29, 2015 14:12
My bash prompt and simple aliases
#!/bin/bash
if [ -f /etc/bash_completion ]; then
source /etc/bash_completion
fi
__has_parent_dir () {
# Utility function so we can test for things like .git/.hg without firing up a
# separate process
test -d "$1" && return 0;
#!/bin/bash
# Bash script to install latest version of ffmpeg and its dependencies on Ubuntu 12.04 or 14.04
# Inspired from https://gist.github.com/faleev/3435377
# Remove any existing packages:
sudo apt-get -y remove ffmpeg x264 libav-tools libvpx-dev libx264-dev
# Get the dependencies (Ubuntu Server or headless users):
sudo apt-get update
#!/bin/bash
#
# install_ffmpeg
#
# Installs the latest ffmpeg and its dependencies on Debian Wheezy for the Raspberry Pi 2
# Inspired from https://gist.github.com/faleev/3435377
#
# Author: Beau Hastings <[email protected]>
if [ $(id -u) -ne 0 ]; then
public class Vocation
{
private long xp;
public readonly string PlayerName;
public int Level;
public long XP
{
get
{
try {
switch (kind)
{
case TraceLevel.Error:
Console.ForegroundColor = ConsoleColor.Red;
break;
case TraceLevel.Warning:
Console.ForegroundColor = ConsoleColor.Yellow;
break;
case TraceLevel.Info:
--- Output from query creator using MySQL
CREATE TABLE `Bans` (`IP` CHAR(16), `Name` TEXT, `UUID` TEXT, `Reason` TEXT, `BanningUser` TEXT, `Date` TEXT, `Expiration` TEXT, PRIMARY KEY (`IP`))
CREATE TABLE `Warps` (`Id` INT AUTO_INCREMENT, `WarpName` VARCHAR(50), `X` INT, `Y` INT, `WorldID` VARCHAR(50), `Private` TEXT, UNIQUE (`WarpName`, `WorldID`), PRIMARY KEY (`Id`))
CREATE TABLE `Regions` (`Id` INT AUTO_INCREMENT, `X1` INT, `Y1` INT, `width` INT, `height` INT, `RegionName` VARCHAR(50), `WorldID` VARCHAR(50), `UserIds` TEXT, `Protected` INT, `Groups` TEXT, `Owner` VARCHAR(50), `Z` INT, UNIQUE (`RegionName`, `WorldID`), PRIMARY KEY (`Id`))
CREATE TABLE `Users` (`ID` INT AUTO_INCREMENT, `Username` VARCHAR(32), `Password` VARCHAR(128), `UUID` VARCHAR(128), `Usergroup` TEXT, `Registered` TEXT, `LastAccessed` TEXT, `KnownIPs` TEXT, UNIQUE (`Username`), PRIMARY KEY (`ID`))
CREATE TABLE `GroupList` (`GroupName` VARCHAR(32), `Parent` VARCHAR(32), `Commands` TEXT, `ChatColor` TEXT, `Prefix` TEXT, `Suffix` TEXT, PRIMA
namespace MyPlugin.Db
{
public class MyPluginDbManager
{
private string _tablePrefix = "plugin";
private string _tableName = "Test";
private readonly IDbConnection _conn;
internal string TableName
{
@hastinbe
hastinbe / fixup-ids.sh
Created October 15, 2015 01:25
Cleans up decompiled TerrariaServer code
#!/bin/bash
#
# fixup-ids
#
# Searches and replaces integer literals with their equivalent enumerated type
#
# Requires:
# dos2unix
# GNU awk >= 4.1.0
#
Current map: orig.wld
Current release: 156
Map release: 156
File type: World
Revision: 1120
IsFavorite? N
World name: PTS 151003, ID=1246390825
World rect: left=0 right=134400 top=0 bottom=38400
Max tiles: X=8400 Y=2400
Expert? N