Skip to content

Instantly share code, notes, and snippets.

View josefnpat's full-sized avatar
what

Seppi josefnpat

what
View GitHub Profile
@josefnpat
josefnpat / bf.php
Created November 4, 2011 18:12
Find stuff
<?php
//From Forum: marioR14.love
$bname = array("mario","mari0","");
$after = array("R","v","alpha","");
$exts = array(".zip",".love",".rar",".7z",".gz",".tar",".tgz");
$it = 100;
/*
$bname = array("mari0");
$after = array("R");
@josefnpat
josefnpat / build-love.sh
Created November 17, 2011 22:36
Bash Script for Building Love2d stuff.
#!/bin/sh
# Cannot have a trailing slash. Arg 1 is folder.
cd $1
zip -r ../${PWD##*/}.love *
cd ..
cat /usr/bin/love $1.love > build_$1
chmod a+x build_$1
@josefnpat
josefnpat / run-love.sh
Created November 29, 2011 01:00
gEdit External Tools Manager: run love
#!/bin/sh
SERVICE=' love '
killall love 2> /dev/null
gnome-terminal -e "love $GEDIT_CURRENT_DOCUMENT_DIR"
@josefnpat
josefnpat / fuckcornflowerblue.lua
Created May 10, 2012 17:26
Force the love engine to quit on error handling
function love.errhand(msg)
print(debug.traceback())
print(msg)
end
@josefnpat
josefnpat / ubuntu-10.04.sh
Created September 20, 2012 23:40
Ubuntu 10.04 Build Script for love 0.8.0
#!/bin/sh
hg clone https://bitbucket.org/rude/love && cd love
hg update 0.8.0
./platform/unix/automagic
CXXFLAGS="-DLOVE_OLD_MODPLUG"
./configure
make
@josefnpat
josefnpat / yago.php
Created October 19, 2012 00:18
Yet Another Get Options
<?php
/**
* Yet Another Get Options
*
* This function will provide a simple alternative to *nix's getopt that has
* some extended features found in GNU's getopts.
*
* @author josefnpat <seppi@josefnpat.com>
*
@josefnpat
josefnpat / main.lua
Last active October 17, 2017 16:51
LÖVE: Line and Circle Collision
circle = {x=400,y=300,r=100}
point = { x = 100, y = 100 }
col = false
function love.draw()
if cols then
love.graphics.print("Collision",0,0)
love.graphics.setColor(255,0,0)
for _,col in pairs(cols) do
@josefnpat
josefnpat / menu.diff
Created November 14, 2012 00:13
diff menu.lua FOUR_schattenkind/scenes/menu.lua --ignore-space-change --ignore-case -U999999999999
--- menu.lua 2012-11-13 19:03:18.343543945 -0500
+++ FOUR_schattenkind/scenes/menu.lua 2012-10-07 09:21:34.000000000 -0400
@@ -1,145 +1,338 @@
-menu = {}
+-- Class
+Menu = class("Menu")
-menu.font_title = love.graphics.newFont("menu/assets/Orbitron Black.ttf",64)
-menu.font_desc = love.graphics.newFont("menu/assets/League_Gothic-webfont.ttf",22)
-menu.font_menu = love.graphics.newFont("menu/assets/League_Gothic-webfont.ttf",26)
@josefnpat
josefnpat / watch.php
Created November 16, 2012 02:18
Watch for changes in a git repo and send to notify-send
#!/usr/bin/php
<?php
while(1){
if("Already up-to-date." == $ans = rtrim(`git pull`)){
echo ".";
} else {
echo "\n$ans\n";
`notify-send "$ans"`;
}
sleep(5);
@josefnpat
josefnpat / mirror.sh
Created November 16, 2012 10:39
Use rsync to mirror folders
#!/bin/sh
MASTER="./master/"
SLAVE="./slave/"
date +%s > ${MASTER}.lastupdate
rsync -vazlpEogt --delete --progress $MASTER $SLAVE