Skip to content

Instantly share code, notes, and snippets.

View jessta's full-sized avatar

Jesse McNelis jessta

View GitHub Profile
@jessta
jessta / server.py
Last active October 3, 2022 03:26 — forked from martijnvermaat/server.py
SimpleHTTPServer with history API fallback
#!/usr/bin/env python
import os
import sys
import urllib
import http.server
class Handler(http.server.SimpleHTTPRequestHandler):
def do_GET(self):
urlparts = urllib.parse.urlparse(self.path)
@jessta
jessta / gist:1808898
Created February 12, 2012 14:53 — forked from notedit/gist:1808849
test_server
package main
import (
"gogobservice"
"net/rpc"
"net"
"log"
)
func main() {
{
process := make(chan *feat.Feature)
buffer := make(chan *feat.Feature, 1000)
wg := new(sync.WaitGroup)
if *cores < 2 {
*cores = 2
}
for i := 0; i < *cores-1; i++ {
go func(){wg.Add(1); processServer(intervalTree, process, buffer); wg.Done()}
}
func Launch(vbox *VBoxSpec, statusch chan<- *VmStatus, quitch <-chan bool) {
go func() {
vboxPath := main.Config["VboxPath"]
vboxHeadlessBin := fmt.Sprintf("%s/VBoxHeadless", vboxPath)
statusch <- VmStatus{vbox, VMSTATUS_LAUNCHING}
var stdoutFilePtr *File