Skip to content

Instantly share code, notes, and snippets.

View aeurielesn's full-sized avatar

Alexander Urieles aeurielesn

View GitHub Profile
@aeurielesn
aeurielesn / gist:615130
Created October 7, 2010 13:51
[eclipse] mixed pydev and jdt project
(in pydev/.project:)
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>pydev</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.python.pydev.PyDevBuilder</name>
@aeurielesn
aeurielesn / gist:618782
Created October 10, 2010 00:46 — forked from anonymous/gist:618773
[eAthena] enhanced callnpcevent
BUILDIN_FUNC(callnpcevent)
{
int i, j;
const char *event_name = script_getstr(st, 2);
struct event_data *event = 0;
struct script_retinfo *ri;
event = strdb_get(ev_db, event_name);
if (!event)
# for usage: ruby timecard.rb --help
require 'rubygems'
require 'optparse'
# This requires the 'cyberfox-gchart' gem (0.5.4), as the standard
# gchart gem is woefully broken for this kind of graph. Broken to the
# point that it's an inherent design choice that doesn't work well for
# this kind of chart. I'm sure that the cyberfox-gchart gem won't
@aeurielesn
aeurielesn / judge.sh
Created January 28, 2011 17:05
A simple script to judge problems using Bash
#!/bin/bash
cnt=0
ZERO=0
for i in {1..10}
do
if [ -f $1.out ]
then
rm $1.out
fi
cp test-data/$1/$1.in.$i $1.in
@aeurielesn
aeurielesn / gist:801304
Created January 29, 2011 00:19
3 ways to change from CR+LF to LF
perl -pi -e 's/\r\n/\n/g' input.file
@aeurielesn
aeurielesn / SharingFilesWindowsXP
Created April 14, 2011 20:50
Troubleshoot when Guest account is asking for password to access network files
1. Activate Guest account.
2. Install the Windows 2003 Server Resource Kit Tools from: http://go.microsoft.com/fwlink/?LinkId=4544.
3. Run Windows Resource Kit Tools' Command Shell.
4. Type:
> ntrights +r SeNetworkLogonRight -u Guest
> ntrights -r SeDenyNetworkLogonRight -u Guest
@aeurielesn
aeurielesn / build.xml
Created August 4, 2011 05:24
ant script to get local revision number from the subversion's .svn/entries file
<?xml version="1.0" encoding="UTF-8"?>
<project name="svn" default="revision-number" basedir=".">
<target name="check-svn-entries">
<available file=".svn/entries" property="svn.entries.present"/>
</target>
<target name="revision-number" depends="check-svn-entries" if="svn.entries.present">
<loadfile srcfile=".svn/entries" property="revision">
<filterchain>
@aeurielesn
aeurielesn / mysql-drop-all-tables.sh
Created August 18, 2011 21:03
Drop all tables from a MySQL database
$ mysqldump -u[USERNAME] -p[PASSWORD] --add-drop-table --no-data [DATABASE] | grep ^DROP | mysql -u[USERNAME] -p[PASSWORD] [DATABASE]
#Source: Thingy Ma Jig Blog (http://www.thingy-ma-jig.co.uk/blog/10-10-2006/mysql-drop-all-tables)
@aeurielesn
aeurielesn / dice-portrait.py
Last active September 28, 2015 03:38
spmacdonald's dice portrait
# http://web.archive.org/web/20091015013516/http://www.elusivesnark.com/2008/11/carolines-dice-portrait.html
PImage img;
PImage cropped_img;
PImage patch;
int _width = 640;
int _height = 1024;
int patch_w = 16;
int patch_h = 16;
@aeurielesn
aeurielesn / gist:1502169
Created December 20, 2011 16:27
Installing Oracle Java Plugin in Ubuntu 11.04
sudo apt-get install sun-java6-plugin
sudo update-alternatives --install /usr/lib/mozilla/plugins/mozilla-javaplugin.so mozilla-javaplugin.so /usr/lib/jvm/java-6-sun/jre/lib/i386/libnpjp2.so 1