Skip to content

Instantly share code, notes, and snippets.

@ghaiklor
ghaiklor / nodejs-native-module.js
Created August 12, 2015 16:25
NodeJS Native Module wrapper in JS
function NativeModule(id) {
this.filename = id + '.js';
this.id = id;
this.exports = {};
this.loaded = false;
}
NativeModule._source = process.binding('natives');
NativeModule._cache = {};
@pdemby
pdemby / csv-input
Last active May 20, 2017 05:33
csv input
IDENTIFICATION DIVISION.
PROGRAM-ID. READ-CSV.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
SELECT INPUT-FILE
ASSIGN TO DISC
ORGANIZATION IS LINE SEQUENTIAL
ACCESS MODE IS SEQUENTIAL.
SELECT OUTPUT-RECORD
@mikeal
mikeal / gist:9242748
Last active June 23, 2020 05:17
Response to Nodejitsu NPM Trademark

I've known people at nodejitsu for years, since before the company even existed. I still consider many of them friends. That said, somebody over there has lost their mind.

Trademarks are an important part of open source. They protect the integrity of the trust that is built by any project. A classic example of why this is the case is Firefox. Suppose that a malware producer takes the Firefox codebase, which is free and open source, packages up their malware with it and then releases it as "Firefox". Then they buy search advertising and suddenly their bad and malicious version of Firefox is the first result on search engines across the web. This is clearly a bad thing for Firefox and open source everywhere, but what can Mozilla do to protect their community of users?

They can't enforce a software license since the use is permitted under the Mozilla Public License. They can, however, enforce on these hypothetical bad actors using their trademark on the word "Fi

18 ;;; 7/0 goes to WAN1
chain=prerouting action=mark-connection new-connection-mark=WAN1_conn passthrough=yes
dst-address-type=!local in-interface=LAN1 connection-mark=no-mark
per-connection-classifier=both-addresses-and-ports:7/0
19 ;;; 7/1 goes to WAN2
chain=prerouting action=mark-connection new-connection-mark=WAN2_conn passthrough=yes
dst-address-type=!local in-interface=LAN1 connection-mark=no-mark
per-connection-classifier=both-addresses-and-ports:7/1
@tiernano
tiernano / gist:8217968
Created January 2, 2014 11:35
mikrotik script for sending from a particular address list to a particular WAN link
9 ;;; WAN1 address list -> WAN1
chain=prerouting action=mark-routing new-routing-mark=to_WAN1 passthrough=no
dst-address=!192.168.0.0/16 dst-address-list=WAN1
10 ;;; WAN2 address list -> WAN2
chain=prerouting action=mark-routing new-routing-mark=to_WAN2 passthrough=no
dst-address=!192.168.0.0/16 dst-address-list=WAN2
11 ;;; WAN3 address list -> WAN3
chain=prerouting action=mark-routing new-routing-mark=to_WAN3 passthrough=no
@ypujante
ypujante / ExceptionJdk17Workaround.groovy
Last active December 15, 2015 15:28
The purpose of this class is to workaround an issue with groovy when running code compiled under jdk1.6 and running it under jdk1.7 (see forum thread: http://groovy.329449.n5.nabble.com/jdk7-and-IncompatibleClassChangeError-for-exception-class-td5714582.html)
/*
* Copyright (c) 2013 Yan Pujante
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@theangryangel
theangryangel / AuthController.js
Created February 28, 2013 21:54
sails (v0.8.82) + passport + passport-local Rough Example. For the love of all that is holy, don't use this in production.
// api/controllers/AuthController.js
var passport = require('passport');
var AuthController = {
login: function (req,res)
{
res.view();
},
package com.tot.samples.RadioButtonCellSample;
import com.google.gwt.cell.client.AbstractEditableCell;
import com.google.gwt.cell.client.Cell;
import com.google.gwt.cell.client.ValueUpdater;
import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.InputElement;
import com.google.gwt.dom.client.NativeEvent;
import com.google.gwt.event.dom.client.KeyCodes;
import com.google.gwt.safehtml.shared.SafeHtml;