Skip to content

Instantly share code, notes, and snippets.

// classes example
// g++ -static-libgcc -static-libstdc++ main.cpp -o main.exe
#include <iostream>
#include <map>
#include <vector>
using namespace std;
class Object {
static vector<Object*> all_objects;
// classes example
// g++ -static-libgcc -static-libstdc++ main.cpp -o main.exe
#include <iostream>
#include <map>
using namespace std;
class Object {
public:
virtual string toString()=0;
// classes example
// g++ -static-libgcc -static-libstdc++ main.cpp -o main.exe
#include <iostream>
#include <map>
using namespace std;
class Object {
public:
virtual string toString()=0;
// classes example
#include <iostream>
using namespace std;
class Object {
public:
virtual string toString()=0;
virtual int toInt()=0;
virtual Object* add(Object* other)=0;
[info] Preparing build dirs
Current branch localAspenBranch is up to date.
HEAD is now at d7e992d file parser queue: major rework to correctly support music albums wihout lucky timing and guessing, parsing times and proper queue restarts
First, rewinding head to replay your work on top of it...
Fast-forwarded master to 9bf1c2ead7ce401ce0f8fc3585e7a0cc47fb3f0f.
HEAD is now at 0c8eec0 MVK: pull new libvlc before re-applying patches
Updating '.':
Fetching external item into 'HTTPFetcher':
External at revision 143.
@dunkfordyce
dunkfordyce / gist:f7e3b902b9ea6870e2f8
Created February 13, 2015 10:27
computercraft altar
-- simple altar turtle
-- anything put in its inventory it will place
-- into the altar and wait for it to become "something else"
-- by dunkfordyce/d1223m
altar = peripheral.wrap('front')
os.queueEvent('turtle_inventory')
while true do
@dunkfordyce
dunkfordyce / index.html
Created November 22, 2012 19:07
midi -> nodejs -> socket.io -> browser
<script src="/socket.io/socket.io.js"></script>
<script>
var socket = io.connect('http://localhost');
socket.on('midi', function (data) {
console.log(data);
});
</script>
@dunkfordyce
dunkfordyce / gist:4065345
Created November 13, 2012 11:38
Convert single line comments in javascript to console.log statements with esprima/falafel/javascript
var falafel = require('falafel');
var src = require('fs').readFileSync(process.argv[2]).toString();
var output = falafel(src, {comment: true}, function (node) {
if (node.type === 'Line') {
node.update('console.log("COMMENT:' + node.value + '");');
}
});
console.log(output);
@dunkfordyce
dunkfordyce / gist:2510192
Created April 27, 2012 15:32
AikarMobFix
package com.empireminecraft.AikarMobFix;
import java.util.logging.Logger;
import org.bukkit.Chunk;
import org.bukkit.World;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Monster;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
# hideFoodBar - sets whether to hide the hunger value from the player, number is the amount of drumsticks to show them, 0-20 to show the 10 bars
# cancelRegen - whether to cancel the automatic regen from a full hunger bar
# deathMessage - whether to show the custom death message saying how long on the server
# playerListHealth - whether to show the health in the player list menu
# transmitDamage - whether to show the damage taken in the chat
# forceHardMode - whether to force difficulty 3 in the worlds specified, comma seperated list of worlds
# removeRecipies - whether to remove the golden apple and glistering melon recipies
# addRecipies - whether to add the new golden apple and glistering melon recipies
# kickBan - whether to kick and ban a player on death, message is the message shown on kick
# randomFirstSpawn: