Skip to content

Instantly share code, notes, and snippets.

View pkrumins's full-sized avatar

Peter Krumins pkrumins

View GitHub Profile
import Prelude hiding (catch)
import System (getArgs)
import System.IO (hPutStrLn, hSetBuffering, BufferMode(NoBuffering), hClose, Handle)
import System.IO.Error (isEOFError, IOError(..))
import Network (connectTo, PortID(..), withSocketsDo)
import Control.Concurrent (forkIO, threadDelay)
import Control.Exception
delay :: Int
delay = 60
// server.js
var dnode = require('dnode');
function Manager () {
var desktops = {};
var self = this;
this.spawn = function (name) {
var $ = require('jquery-browserify');
$(window).ready(function () {
if (!window.navigator.userAgent.match(/chrome|chromium/i)) {
$('<div>')
.addClass('alert')
.append(
$('<img>').attr('src', '/img/chrome.png'),
$('<div>').text(
"You don't appear to be using chrome, "
#include <windows.h>
#include <cstdio>
int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE, PWSTR pCmdLine, int nCmdShow) {
while (1) {
HWND dialog = FindWindow("MozillaDialogClass", "FireFox Update");
if (dialog) {
printf("Found dialog: %x\n", dialog);
HWND dialogItem = NULL;
SendMessage(dialog, WM_CLOSE, 0, 0);
<?php
$browserlingTunnelPort = 59374;
$browserlingTunnelUrl = "http://tunnel.browserling.com:" . $browserlingTunnelPort . "/WordPress/TestingWp/";
if ($_SERVER['REMOTE_ADDR'] != '127.0.0.1') {
define('WP_SITEURL', $browserlingTunnelUrl);
define('WP_HOME', $browserlingTunnelUrl);
update_option('siteurl', $browserlingTunnelUrl);
[daemons]
; enable SSL support by uncommenting the following line and supply the PEM's below.
; the default ssl port CouchDB listens on is 6984
; httpsd = {couch_httpd, start_link, [https]}
compaction_daemon={couch_compaction_daemon, start_link, []}
[compaction_daemon]
; The delay, in seconds, between each check for which database and view indexes
; need to be compacted.
check_interval = 300
iptables.list('Tunnels', function (rules) {
var ports = {};
rules.forEach(function (rule) {
if (rule.parsed.target == 'REJECT') return;
// extract tcp destination ports
var match = rule.raw.match(/tcp dpt:(\d+)/);
if (match) {
ports[parseInt(match[1])] = 1;
use warnings;
use strict;
use Text::CSV;
use constant {
ID => 0,
TYPE => 1,
SOURCE => 2,
AMOUNT => 3,
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pkrumins
pkrumins / nylki-lindenmayer-browser.js
Created June 20, 2019 20:28
nylki/lindenmayer library that works in IE
/* This is a modified version of https://github.com/nylki/lindenmayer.
** The modifications make it work in Internet Explorer again.
** The modifications include:
** * Replacing `let` with `var`.
** * Replacing `{ x }` with `{ x : x }` in object context.
** * Replacing `class` with `function.
** * Replacing `{ arg1, arg2, }` with `opts` in function definition context.
** * Replacing `x of obj` with a `for (var i = 0; i < obj.length; i++)`
** * Replacing default arguments with `if (arg === undefined) { arg = defaultVal; }`
** * Replacing `array.push(...obj)` with `array.extend(obj)`.