Skip to content

Instantly share code, notes, and snippets.

View fjakobs's full-sized avatar

Fabian Jakobs fjakobs

View GitHub Profile
{"name":"Databricks","extensions":"[{\"identifier\":{\"id\":\"databricks.databricks\",\"uuid\":\"4e20f34d-db3e-411d-9294-6aca28da3d4f\"},\"displayName\":\"Databricks\"},{\"identifier\":{\"id\":\"databricks.sqltools-databricks-driver\",\"uuid\":\"b730b4e8-cc8a-4fdc-9087-1898579562be\"},\"displayName\":\"Databricks Driver for SQLTools\"},{\"identifier\":{\"id\":\"ms-python.python\",\"uuid\":\"f1f59ae4-9318-4f3c-a9b5-81b2eaa5f8a5\"},\"displayName\":\"Python\"},{\"identifier\":{\"id\":\"ms-python.vscode-pylance\",\"uuid\":\"364d2426-116a-433a-a5d8-a5098dc3afbd\"},\"displayName\":\"Pylance\"},{\"identifier\":{\"id\":\"ms-toolsai.jupyter\",\"uuid\":\"6c2f1801-1e7f-45b2-9b5c-7782f1e076e8\"},\"displayName\":\"Jupyter\"},{\"identifier\":{\"id\":\"ms-toolsai.jupyter-keymap\",\"uuid\":\"9f6dc8db-620c-4844-b8c5-e74914f1be27\"},\"displayName\":\"Jupyter Keymap\"},{\"identifier\":{\"id\":\"ms-toolsai.jupyter-renderers\",\"uuid\":\"b15c72f8-d5fe-421a-a4f7-27ed9f6addbf\"},\"displayName\":\"Jupyter Notebook Renderers\"},{\"id
@fjakobs
fjakobs / fifo_bug.js
Created March 6, 2014 14:52
node.js when opening multiple fifos
// Opening fifos, which nobody is reading from causes strange behaviour and has
// side effects on opening network connections to localhost
// Bug #1
// ------
// run with "node fifo_bug.js 1"
// The client will connect but process.exit(0) has will not terminate the process
// then do "cat fifos/fifo0"
// this will cause the process to exit
// Note: this does not happen with 0.6 or 0.8
@fjakobs
fjakobs / mysql-ctl
Last active December 4, 2018 10:27
#!/bin/bash
if ! [ $# -eq 1 ]
then
echo "Usage: $0 [start|restart|stop|status|cli|install]"
exit 1
fi
export STOPTIMEOUT=10
MYSQL_DIR="$HOME/lib/mysql"
@fjakobs
fjakobs / ruby2.0.sh
Last active December 16, 2015 21:39
#!/bin/bash
# install rvm
curl -#L https://get.rvm.io | bash -s stable --autolibs=3 --ruby
source $HOME/.rvm/scripts/rvm
echo rvm_autolibs_flag=0 >> ~/.rvmrc
echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"' >> .bashrc
# install ruby
rvm install 2.0.0
@fjakobs
fjakobs / ssl_terminate.js
Created July 16, 2012 19:00
SSL termination proxy
var tls = require("tls");
var net = require("net");
var fs = require("fs");
var host = "c9.dev";
tls.createServer({
key: fs.readFileSync(__dirname + "/key.pem"),
cert: fs.readFileSync(__dirname + "/cert.pem")
}, function(client) {
var architect = require("architect");
var fs = require("fs");
var path = require("path");
var user = {
name: "fjakobs",
uid: 1
};
var project = {
name: "geekdots",
@fjakobs
fjakobs / index.html
Created July 18, 2011 08:26
node-http-proxy bug #70
<html>
<body>
JUHU
<script>
var req = new XMLHttpRequest();
req.multipart = true;
req.open("GET", "/xhr");
req.onload = function(){
if (req.readyState == 4)
//npm install http-proxy socket.io@0.6.17
var server = require("http").createServer(function(req, res) {
res.writeHead(200, {"content-type": "text/html"});
res.end("<html><body><script src='/socket.io/socket.io.js'></script>\
<script>\
var socket = new io.Socket(null, {transports: ['xhr-multipart']});\
socket.connect();\
</script></body></html>");
})
@fjakobs
fjakobs / gist:944457
Created April 27, 2011 15:23
ace unit test output after diet merge
telefonmann:ace fjakobs$ node lib/ace/test/all.js
[4/1] test: toggle comment lines should not do anything OK
[4/2] test: lines should keep indentation OK
[4/3] test: new line after { should increase indent OK
[4/4] test: no indent increase after { in a comment OK
[5/1] test: tokenize pixel number OK
[5/2] test: tokenize hex3 color OK
[5/3] test: tokenize hex6 color OK
[5/4] test: tokenize parens OK
[5/5] test for last rule in ruleset to catch capturing group bugs OK
@fjakobs
fjakobs / xhr-multipart.patch
Created January 6, 2011 12:29
xhr multipart patch
XHRMultipart.prototype._get = function(){
var self = this;
this._xhr = this._request('', 'GET', true);
- this._xhr.onreadystatechange = function(){
- if (self._xhr.readyState == 3) self._onData(self._xhr.responseText);
- };
+ if ("onload" in this._xhr) {
+ this._xhr.onload = function() {
+ self._onData(self._xhr.responseText);
+ }