Skip to content

Instantly share code, notes, and snippets.

View macalinao's full-sized avatar

Ian Macalinao macalinao

View GitHub Profile
addMod(function(){
var mod = mm.defineMod("My Mod", {
description: "An awesome mod.",
author: "AlbireoX",
revision: 1,
url: "http://simplyian.com"
});
var ore = mod.addOre("main-ore", {
An error occurred while collecting items to be installed
session context was:(profile=PlatformProfile, phase=org.eclipse.equinox.internal.p2.engine.phases.Collect, operand=, action=).
No repository found containing: osgi.bundle,ch.qos.logback.classic,0.9.27.v20110224-1110
No repository found containing: osgi.bundle,ch.qos.logback.core,0.9.27.v20110224-1110
No repository found containing: osgi.bundle,ch.qos.logback.slf4j,0.9.27.v20110224-1110
No repository found containing: osgi.bundle,com.android.ide.eclipse.adt,18.0.0.v201203301601-306762
No repository found containing: org.eclipse.update.feature,com.android.ide.eclipse.adt,18.0.0.v201203301601-306762
No repository found containing: osgi.bundle,com.android.ide.eclipse.ddms,18.0.0.v201203301601-306762
No repository found containing: org.eclipse.update.feature,com.android.ide.eclipse.ddms,18.0.0.v201203301601-306762
No repository found containing: osgi.bundle,com.android.ide.eclipse.hierarchyviewer,18.0.0.v201203301601-306762
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="CoreNLP-to-HTML.xsl" type="text/xsl"?>
<root>
<document>
<sentences>
<sentence id="1">
<tokens>
<token id="1">
<word>A</word>
<lemma>a</lemma>
@macalinao
macalinao / options.js
Created May 6, 2012 19:30 — forked from vpalos/options.js
Small but effective CLI argument parser for JavaScript (NodeJs).
/** Command-line options parser (http://valeriu.palos.ro/1026/).
Copyright 2011 Valeriu Paloş ([email protected]). All rights reserved.
Released as Public Domain.
Expects the "schema" array with options definitions and produces the
"options" object and the "arguments" array, which will contain all
non-option arguments encountered (including the script name and such).
Syntax:
[«short», «long», «attributes», «brief», «callback»]
@macalinao
macalinao / latency.txt
Created June 6, 2012 05:50 — forked from jalcine/latency.txt
Latency numbers every programmer should know
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns
Mutex lock/unlock 25 ns
Main memory reference 100 ns
Compress 1K bytes with Zippy 3,000 ns
Send 2K bytes over 1 Gbps network 20,000 ns
Read 1 MB sequentially from memory 250,000 ns
Round trip within same datacenter 500,000 ns
Disk seek 10,000,000 ns
public class BlockBreaker extends JavaPlugin implements Listener {
private List<BlockDef> blocks = new ArrayList<BlockDef>();
public void onEnable() {
Bukkit.getPluginManager.registerEvents(this);
Bukkit.getScheduler.scheduleSyncRepeatingTask(this, new Runnable() {
for (BlockDef def : BlockBreaker.this.blocks) {
if (def.time < System.currentTimeMillis()) {
continue;
public class BlockBreaker extends JavaPlugin implements Listener {
private List<BlockDef> blocks = new ArrayList<BlockDef>();
public void onEnable() {
Bukkit.getPluginManager.registerEvents(this);
Bukkit.getScheduler.scheduleSyncRepeatingTask(this, new Runnable() { public void run(){
for (BlockDef def : BlockBreaker.this.blocks) {
if (def.time < System.currentTimeMillis()) {
continue;
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var Player = require('./player');
var Game = new Schema({
type: {
type: String,
required: true
},
date: {
Error: EMFILE, too many open files '/home/savagegames.net/views/index.jade'
at Object.openSync (fs.js:240:18)
at Object.readFileSync (fs.js:128:15)
at View.contents (/home/savagegames.net/node_modules/express/lib/view/view.js:121:13)
at Function.compile (/home/savagegames.net/node_modules/express/lib/view.js:68:45)
at ServerResponse._render (/home/savagegames.net/node_modules/express/lib/view.js:417:18)
at ServerResponse.<anonymous> (/home/savagegames.net/node_modules/express/lib/view.js:318:17)
at /home/savagegames.net/node_modules/express-mongoose/index.js:45:21
at resolve (/home/savagegames.net/node_modules/express-mongoose/index.js:75:12)
at ServerResponse.expressmongoose [as render] (/home/savagegames.net/node_modules/express-mongoose/index.js:37:12)
String group = RoyalCommands.permission.getPrimaryGroup(p);
if (group == null) group = "";
ConfigurationSection groups = plugin.homeLimits.getConfigurationSection("groups");
ConfigurationSection players = plugin.homeLimits.getConfigurationSection("players");
Integer limit;
if (players != null && players.contains(p.getName())) limit = players.getInt(p.getName());
else if (groups != null && groups.contains(group)) limit = groups.getInt(group);
else limit = null;
// limit = (players != null && players.contains(p.getName())) ? players.getInt(p.getName()) : (groups != null && groups.contains(group)) ? groups.getInt(group) : null;
// This should work, but IntelliJ says it could throw an NPE, so I'm playing it safe ^