Skip to content

Instantly share code, notes, and snippets.

View dobesv's full-sized avatar

Dobes Vandermeer dobesv

View GitHub Profile
@dobesv
dobesv / NioBuf.patch
Created March 9, 2012 04:31
NioBuf as a patch
diff --git a/src/sys/fan/Buf.fan b/src/sys/fan/Buf.fan
--- a/src/sys/fan/Buf.fan
+++ b/src/sys/fan/Buf.fan
@@ -605,10 +605,19 @@
}
**************************************************************************
+** NioBuf
+**************************************************************************
+
@dobesv
dobesv / Buf.asByteBuffer.patch
Created March 15, 2012 08:59
Buf asByteBuffer patch
diff -r cb58d11083c7 src/sys/java/fan/sys/Buf.java
--- a/src/sys/java/fan/sys/Buf.java Thu Mar 15 14:50:08 2012 +0800
+++ b/src/sys/java/fan/sys/Buf.java Thu Mar 15 16:59:06 2012 +0800
@@ -11,6 +11,8 @@
import java.math.*;
import java.nio.*;
+import fanx.interop.Interop;
+
/**
// Create a new bookmark, write javascript: and paste in the next line:
// When you are on the WebEx page to fill out name and email, click the bookmarklet
(function (name, email) { var f=window.parent.frames[1], e=(function(id) { return f.document.getElementById(id) }), an = e('attendeeName'), ae = e('attendeeEmail'), but=e('mwx-btn-pmr-enter-lobby'); an.value=name; f.AttEmailOnblur(); ae.value='dvandermeer@pulsesecure.net'; but.disabled=false; })("Dobes Vandermeer", 'dvandermeer@pulsesecure.net')
@dobesv
dobesv / cityburner.elm
Created January 30, 2013 18:59
This source file causes the elm compiler to fail with "out of memory".
import Automaton (init')
import JavaScript
import JavaScript.Experimental
foreign import jsevent "provideRobotAnimation"
(castElementToJSElement (spacer 0 0))
jsRobotAnimation :: Signal JSElement
robotAnimation = lift (castJSElementToElement 262 373) jsRobotAnimation
@dobesv
dobesv / cityburner.elm
Created January 30, 2013 19:09
Moving the buildings to their own variables allows compilation to complete but it still takes 65 seconds.
import Automaton (init')
import JavaScript
import JavaScript.Experimental
foreign import jsevent "provideRobotAnimation"
(castElementToJSElement (spacer 0 0))
jsRobotAnimation :: Signal JSElement
robotAnimation = lift (castJSElementToElement 262 373) jsRobotAnimation
@dobesv
dobesv / .htaccess
Last active January 4, 2016 10:18 — forked from thoop/.htaccess
# Change YOUR_TOKEN to your prerender token and uncomment that line if you want to cache urls and view crawl stats
# Change http://example.com (at the end of the last RewriteRule) to your website url
<IfModule mod_headers.c>
#RequestHeader set X-Prerender-Token "YOUR_TOKEN"
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
@dobesv
dobesv / combinejs.js
Created January 21, 2012 11:06
Combine, minify, and compress javascript files. Supports "watching" the files for automatic updates
#!node
var fs = require('fs'),
path = require('path'),
gzip = require('./gzip');
function process(fileBody, options, cb) {
if(typeof(fileBody) === 'object') {
options = fileBody;
fileBody = undefined;
cb = options;
@dobesv
dobesv / menu.py
Created June 10, 2016 06:03
Example TkInter menu using image buttons
import Tkinter as tk
import os.path
PROJECT_DIR = os.path.abspath(os.path.dirname(__file__))
def _abspath(name):
return os.path.abspath(os.path.join(PROJECT_DIR, name))
class Application(tk.Frame):
def __init__(self, master=None, background_color='#000000', background_image=None):
#!/usr/bin/env bash
PROJECT_DIR=$(git rev-parse --show-toplevel)
BASE_COMMIT='upstream/develop'
OLD_ERRS=$(mktemp)
NEW_ERRS=$(mktemp)
# Clean up temp files on interrupt/exit
trap "rm -f $NEW_ERRS" EXIT SIGINT
@dobesv
dobesv / gulpfile.js
Last active June 30, 2016 06:39 — forked from anonymous/gulpfile.js
Reproduce RegularExpression condition bug with new version of node (6.2.2)
var gulp = require('gulp');
var plugins = require('gulp-load-plugins')();
var del = require('del');
var merge = require('merge-stream');
var path = require('path');
var RevAll = require('gulp-rev-all');
var runSequence = require('run-sequence');
var os = require('os');
src = [