Skip to content

Instantly share code, notes, and snippets.

View alexbevi's full-sized avatar
🙀

Alex Bevilacqua alexbevi

🙀
View GitHub Profile
Just so you know, running an md5 sum on the two files (with no alteration to the generated text file) should yield identical results ;)
alex@home:~$ md5sum RETEZCE.DFW RETEZCE.DFW.NEW
6127b1f6e0cfc23bb1a42959063034d8 RETEZCE.DFW
6127b1f6e0cfc23bb1a42959063034d8 RETEZCE.DFW.NEW
@alexbevi
alexbevi / gist:1113777
Created July 29, 2011 13:10
git filter-branch to rewrite asylum history to prepend "ASYLUM: " to all entries that need it
git filter-branch -f --msg-filter '
i=0
while read line
do
if [ $i -eq 0 ];
then
if expr "$line" : ".*ASYLUM:.*" > /dev/null;
then
echo "$line"
else
@alexbevi
alexbevi / ffiv_lua_script.lua
Created October 19, 2011 09:35
Final Fantasy IV SNES9x Lua Script
-- --------------------------- --
-- Final Fantasy IV LUA script --
-- --
-- By: Pasky13 --
-- --------------------------- --
-- Globals
char_atbm = {0, 0, 0, 0, 0}
enemy_atbm = {0, 0, 0, 0, 0, 0, 0, 0}
@alexbevi
alexbevi / goto-test.rb
Created November 9, 2011 14:03
Ruby GOTO
require 'goto'
def test
frame_start
label(:start) { goto :b }
label(:a) { print "world!\n"; goto :c }
label(:b) { print "hello "; goto :a }
--- Weapons ---
SPIKE KNUCKLE
Type: Gloves
Gfx: 00
Pal: 02
Effective: None
Critical: 0
Hit: 75
Attack: 2
Inflict: None
Rabite: None
Buzz Bee: Mana
Mushboom: Mana
Chobin Hood: None
Lullabud: Mana
Iffish: Water
Kid Goblin: Earth
Eye Spy: Water
Green Drop: None
Specter: Dark
@alexbevi
alexbevi / pre-commit.sh
Created August 23, 2012 12:05
Git pre-commit hook that checks ruby source files for Pry breakpoints
# Git pre-commit hook to check all staged Ruby (*.rb/haml/coffee) files
# for Pry binding references
#
# Installation
#
# ln -s /path/to/pre-commit.sh /path/to/project/.git/hooks/pre-commit
#
# Based on
#
# http://codeinthehole.com/writing/tips-for-using-a-git-pre-commit-hook/
#!/bin/sh
#
# init.d script with LSB support.
#
# Copyright (c) 2007 Javier Fernandez-Sanguino <[email protected]>
#
# This is free software; you may redistribute it and/or modify
# it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2,
# or (at your option) any later version.
@alexbevi
alexbevi / install_mongodb.sh
Created August 29, 2012 17:44
Automate installation of mongodb
#!/bin/bash
PKG=mongodb-linux-x86_64-2.2.0
URL=http://fastdl.mongodb.org/linux
if [ -f /etc/init.d/mongod ]
then
echo "mongod already installed ... stopping"
sudo service mongod stop
else
@alexbevi
alexbevi / global-search.patch
Created September 23, 2012 21:15
Redmine + Knowledgebase Patches for Global Search (proposed)
diff --git a/app/controllers/articles_controller.rb b/app/controllers/articles_controller.rb
index 6bae37b..8057da6 100644
--- a/app/controllers/articles_controller.rb
+++ b/app/controllers/articles_controller.rb
@@ -83,7 +83,7 @@ class ArticlesController < KnowledgebaseController
end
def tagged
- @tag = params[:id]
+ @tag = params[:article_id] || params[:id]