Skip to content

Instantly share code, notes, and snippets.

View josefnpat's full-sized avatar
what

Seppi josefnpat

what
View GitHub Profile
@josefnpat
josefnpat / mining_calculator.lua
Created January 18, 2015 23:05
Mining Amount Calculator
BARGE_LEVEL = 5
EXHUMER_LEVEL = 4
LOW_SLOT_BONUS = 0.09 -- MLU II
MA = 360
MINING_LEVEL = 5
MINING_FOREMAN_LEVEL = 5
ASTROGEOLOGY_LEVEL = 5
ships = {
{
@josefnpat
josefnpat / getsystemram.lua
Created February 1, 2015 20:06
GetSystemRAM
-- Gets the total amount of RAM in the system, in MB.
function GetSystemRAM()
return 0
end
if jit then
local ffi = require("ffi")
ffi.cdef [[
typedef struct SDL_version
@josefnpat
josefnpat / potatoplayer.php
Last active August 29, 2015 14:17
Potato Player (A simple CLI smart playlist script)
#!/usr/bin/php
<?php
$shell_command='mplayer "%s" 2> /dev/null';
$shell_wait=5;
if(file_exists("playlist")){
$raw_playlist = file_get_contents("playlist");
$playlist = explode("\n",trim($raw_playlist));
@josefnpat
josefnpat / setup_termbin.sh
Created April 7, 2015 16:14
setup termbin (tb)
#!/bin/sh
echo 'alias tb="nc termbin.com 9999"' >> .bashrc
@josefnpat
josefnpat / bump.lua
Created May 8, 2015 20:41
Example usage of bump.lua for radius object based gameplay
local bump = {
_VERSION = 'bump v3.1.2',
_URL = 'https://github.com/kikito/bump.lua',
_DESCRIPTION = 'A collision detection library for Lua',
_LICENSE = [[
MIT LICENSE
Copyright (c) 2014 Enrique García Cota
Permission is hereby granted, free of charge, to any person obtaining a
@josefnpat
josefnpat / TLibCompress.lua
Last active August 29, 2015 14:22
TLibCompress
-- TLibCompress.lua
--
-- Authors: jjsheets and Galmok of European Stormrage (Horde)
-- Email: sheets.jeff@gmail.com and galmok@gmail.com
-- Licence: GPL version 2 (General Public License)
--
-- Hacked severely by Taehl (SelfMadeSpirit@gmail.com)
-- More hacking by Josefnpat (seppi@josefnpat.com)
--------------------------------------------------------------------------------
@josefnpat
josefnpat / xapalus_deluxe_server.md
Last active August 29, 2015 14:22
Xapalus Deluxe Server Documentation

Xapalus Deluxe Server Documentation

While the Xapalus Deluxe client is free, the server code is not, and is available for only $1 from itch.io!. This document will help you set up a Xapalus Deluxe server.

Setting up a server should be relatively painless; the basic idea is that an enet instance will be hosted by a headless version of LÖVE.

Requirements

function CountSyllables(word)
local vowels = { 'a','e','i','o','u','y' }
local numVowels = 0
local lastWasVowel = false
for i = 1, #word do
local wc = string.sub(word,i,i)
local foundVowel = false;
for _,v in pairs(vowels) do
if (v == string.lower(wc) and lastWasVowel) then
diff --git a/src/voxeditor.cpp b/src/voxeditor.cpp
index 0b159ea..55a3db2 100644
--- a/src/voxeditor.cpp
+++ b/src/voxeditor.cpp
@@ -665,7 +665,7 @@ void VoxelEditor::mouseMoveEvent(QMouseEvent * e)
bool left = e->buttons() & Qt::LeftButton;
bool right = e->buttons() & Qt::RightButton;
- if (e->modifiers() == Qt::AltModifier) {
+ if (e->modifiers() == Qt::MetaModifier) {
@josefnpat
josefnpat / .gitignore
Last active September 25, 2015 05:07
Mifi Info Script
history.json