Skip to content

Instantly share code, notes, and snippets.

View Shoeboxam's full-sized avatar

Michael Shoemate Shoeboxam

View GitHub Profile
@Shoeboxam
Shoeboxam / mini_compile.sh
Created May 9, 2014 23:26
mini_compile.sh
#Temporary script to generate a universal pack from the mod repository
#We are working on a cleaner implementation at this time (same as what we have done on Soartex)
#Place in mod repository root and run in linux (sh mini_compile.sh)
#Created by Artdude and Shoeboxam
resource_pack=${PWD##*/}
for i in */; do
cd "$i"
@Shoeboxam
Shoeboxam / normalmap_wrapper.py
Created December 16, 2014 18:33
Gimp Normalmap bugged script
#!/usr/bin/env python
from gimpfu import *
import glob
import sys
import os
def normalmap_wrapper(glob_pattern, source):
sys.stderr = open('C:\Users\mike_000\Desktop\errorstream.txt', 'a')
sys.stdout = open('C:\Users\mike_000\Desktop\outstream.txt', 'a')
#!/usr/bin/env python
from gimpfu import *
import os
import os.path
import glob
import sys
# This adds the suffix to the end of the file
def modify_path(image, insertion):
from PIL import Image
import math
img = Image.open(r"C:\Users\mike_000\Desktop\planks_oak.png")
board_widths = [16, 16, 16, 16]
resize_factor = img.size[0] / 16
fence_side = img.crop([0, 0, img.size[0], img.size[1]])
fence_top = img.crop([0, 0, img.size[0], img.size[1]])
@Shoeboxam
Shoeboxam / study.py
Created March 24, 2015 01:44
Psych GPA vs work hours faux study
import random
import matplotlib.pyplot as plt
import numpy as np
respondents = 23
random.seed()
gpa = []
@Shoeboxam
Shoeboxam / spectrophotometry.py
Last active August 29, 2015 14:19
Spectrophotometry Lab
import matplotlib.pyplot as plt
import numpy
from numpy.linalg import lstsq
concentrations = numpy.asarray((.25, .20, .15, .1, .05))
absorbtivities = numpy.asarray((.131, .129, .126, .119, .109))
# Prepare data for fitting
conc_vstack = numpy.vstack([concentrations, numpy.ones(len(concentrations))]).T
@Shoeboxam
Shoeboxam / Sales_Pay.sql
Created May 8, 2015 01:59
SQL Script to generate payment information for salesmen
USE Sandbox
DROP TABLE Salesmen
DROP TABLE Pay
DROP PROC spReadPayRecord
DROP FUNCTION fnCalcPay
DROP FUNCTION fnCalcComm
DROP FUNCTION fnCalcBonus
DROP PROC spUpdatePay
@Shoeboxam
Shoeboxam / SpeedCrunch.ahk
Created August 8, 2015 02:51
Remap numlock to speedcrunch calculator tape
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
SetNumLockState AlwaysOn
NumLock::
IfWinExist, SpeedCrunch
WinClose SpeedCrunch
@Shoeboxam
Shoeboxam / stage-graphic.py
Created August 4, 2016 03:03
Gimp python-fu plugin to resize and set the image's data type.
#!/usr/bin/env python
from gimpfu import *
def stage_graphic(image, drawable):
pdb.gimp_context_set_interpolation(0)
pdb.gimp_image_scale(image, pdb.gimp_image_width(image) * 4, pdb.gimp_image_height(image) * 4)
if (pdb.gimp_image_base_type(image)):
pdb.gimp_image_convert_rgb(image)
@Shoeboxam
Shoeboxam / pack_compiler.sh
Created August 4, 2016 03:06
Simple patch management
filename=$PWD/patchnames.txt
while read -r line
do
cp -R $PWD/Modded-1.7.x/$line"/assets/" $PWD/FTBInventions/minecraft/resourcepacks/Soartex_Modded
done < "$filename"