Skip to content

Instantly share code, notes, and snippets.

@gekowa
gekowa / tcpproxy.js
Last active May 17, 2024 08:21 — forked from kfox/tcpproxy.js
A basic TCP proxy written in node.js
var net = require("net");
process.on("uncaughtException", function(error) {
console.error(error);
});
if (process.argv.length != 5) {
console.log("Usage: %s <localport> <remotehost> <remoteport>", process.argv[1]);
process.exit();
}
@gekowa
gekowa / ids.txt
Last active July 16, 2016 09:02
SafariBooksOnline Best Video 2015 Links
Microservices Architecture Basics: Best of 2015
9781491935811
9781491932636
9780134398747
Tips For Becoming a Better Manager: Best of 2015
9780133749076
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
public static class Retry {
public static void Do(
Action action,
TimeSpan retryInterval,
int retryCount = 3) {
Do<object>(() => {
action();
return null;
}, retryInterval, retryCount);
@gekowa
gekowa / Mac Classic_A1.tmTheme
Created March 30, 2015 13:40
Dimmed Mac Classic TextMate theme
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>author</key>
<string>Origianlly by Chris Thomas</string>
<key>name</key>
<string>Mac Classic A1</string>
<key>settings</key>
<array>
var blockSize = 2;
function Montage(canvas) {
document._MontageObj = this;
IsBlack=function(c){
var white=(c.R==0 && c.G==0 && c.B==0 && c.A==0) || (c.R>250 && c.G>250 && c.B>250);
return !white;
};
public class DrawerActivity extends ActionBarActivity {
private DrawerLayout mDrawerLayout = null;
private ListView mDrawerList = null;
private String[] mDrawerItems;
private ActionBarDrawerToggle mDrawerToggle = null;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_drawer_layout);
@gekowa
gekowa / jshint-config.json
Last active August 29, 2015 14:04
My JSHint config
{
// Settings
"passfail" : false, // Stop on first error.
"maxerr" : 200, // Maximum errors before stopping.
// Predefined globals whom JSHint will ignore.
"browser" : true, // Standard browser globals e.g. `window`, `document`.
"node" : false,
@gekowa
gekowa / jshint.xml
Created May 8, 2014 00:59
JSHint rules for Visual Studio 2012 JSLint plugin
<?xml version="1.0"?>
<Options xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Enabled>true</Enabled>
<ErrorCategory>Warning</ErrorCategory>
<TODOEnabled>false</TODOEnabled>
<TODOCategory>Task</TODOCategory>
<RunOnBuild>true</RunOnBuild>
<CancelBuildOnError>true</CancelBuildOnError>
<JSLintOptions>
<BoolOptions2>
@gekowa
gekowa / node-ping-graph.js
Created March 1, 2013 04:41
Usage: node node-ping-graph.js <IP Address> Works only on Windows.
var cols = process.stdout.columns,
rows = process.stdout.rows,
spawn = require('child_process').spawn,
i, j,
red = '\u001b[31m',
blue = '\u001b[34m',
green = '\u001b[32m',
white = '\u001b[37m',