Skip to content

Instantly share code, notes, and snippets.

View sapslaj's full-sized avatar

Justin Roberson sapslaj

View GitHub Profile
@sapslaj
sapslaj / chrome_app_generator.rb
Last active December 15, 2015 22:39
Quickly make Chrome Apps from URLs! (Now with ICONS!)
# written by sapslaj
print "Quick Chrome URL App Generator Thingy\n"
print "=====================================\n"
print "Name:\n"
name = gets
print "App URL: \n"
appurl = gets
@sapslaj
sapslaj / mybb_theme_decompile.rb
Last active December 24, 2015 21:09
MyBB theme decompiler
unless File.exist?("#{File.absolute_path(ARGV[0])}")
print "Theme file \"#{File.absolute_path(ARGV[0])}\" does not exist.\n"
exit
end
begin
gem "xml-simple"
rescue LoadError
system("gem install xml-simple")
Gem.clear_paths
@sapslaj
sapslaj / spriteviewer.html
Last active January 1, 2016 23:09
Mini sprite viewer made with jQuery and some CSS tricks. Set variables in the URL, ie: spriteviewer.html?image=http://i.imgur.com/GAZG8wV.png&framesize=40&framecount=8&fps=30
<!doctype html>
<html>
<body>
<div id="canvas"></div>
<script src="//code.jquery.com/jquery-1.10.2.min.js"></script>
<script>
var options = {};
window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function (m, key, value) {
options[key] = value;
});
@sapslaj
sapslaj / example.rb
Created January 25, 2014 02:54
Shitty JSON configuration manager. Based (sort of) on configatron
Settings.defaults = {:email=>'[email protected]', :database=>{:url=>'postgres://localhost/foo'}}
Settings.load(organization_name: 'My Company', application_name: 'My Application')
configatron.email # => "[email protected]"
configatron.database.url = 'postgres://localhost/foo_development'
Settings.save # => "{"email":"[email protected]", "database":{"url":"postgres://localhost/foo_development"}}"
@sapslaj
sapslaj / 1.bash
Last active August 29, 2015 13:57
Color scheme scripts
#!/usr/bin/bash
#
# This file echoes a bunch of color codes to the
# terminal to demonstrate what's available. Each
# line is the color code of one foreground color,
# out of 17 (default + 16 escapes), followed by a
# test use of that color on all nine background
# colors (default + 8 escapes).
#
@sapslaj
sapslaj / gist:96cc4b23024e773bdf34
Last active August 29, 2015 14:03
QnD JS Build tool
require 'digest'
def build_js(start_file, compiled_file, options={})
File.open(compiled_file, "w") do |io|
@builder = BuildJS::Builder.new(start_file, options)
io.write @builder.build
end
end
namespace WindowsGame2
import System.IO
import Microsoft.Xna.Framework
public class Extractor(Game):
private graphics as GraphicsDeviceManager
private basePath as string
private outPath as string
@sapslaj
sapslaj / client_routes.js.erb
Created December 28, 2014 10:37
Client side URL helpers generated from Rails routes
<%= ClientRoutes.to_js %>
// ==UserScript==
// @name maget lonk hjander
// @namespace http://layer8.link
// @version 0.1
// @description handle magenet links like apro.
// @author layer8
// @match *://*/*
// @grant GM_log
// @require http://code.jquery.com/jquery-2.1.3.min.js
// @require http://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/md5.js
@sapslaj
sapslaj / .stignore
Last active October 3, 2018 07:25
Syncthing .stignore
// Windows image file caches
Thumbs.db
ehthumbs.db
// Folder config file
Desktop.ini
// Recycle Bin used on file shares
$RECYCLE.BIN/