Skip to content

Instantly share code, notes, and snippets.

View joshthecoder's full-sized avatar

Joshua Roesslein joshthecoder

View GitHub Profile
./build/linux/Drillbit/Resources/test_harness/test_harness/test_harness --profile="./build/linux/Drillbit/Resources/test_results/python.prof" --logpath="./build/linux/Drillbit/Resources/test_results/python.log" --bundled-component-override="./build/linux/Drillbit" --debug --results-dir="./build/linux/Drillbit/Resources/test_results" --attach-debugger --g-fatal-warning
diff --git a/bottle.py b/bottle.py
index 48ceea4..ddf7ad4 100644
--- a/bottle.py
+++ b/bottle.py
@@ -608,6 +608,9 @@ class ServerAdapter(WSGIAdapter):
def __repr__(self):
return "%s (%s:%d)" % (self.__class__.__name__, self.host, self.port)
+ def stop(self):
+ return
diff --git a/pystache/view.py b/pystache/view.py
index 2e5ee41..0a4ac9d 100644
--- a/pystache/view.py
+++ b/pystache/view.py
@@ -34,7 +34,7 @@ class View(object):
return template
def template_name(self):
- return self.__class__.__name__
+ return self.__class__.__name__.lower()
def while_true():
i = 0
while True:
i += 1
if i > 10000:
break
def while_1():
i = 0
while 1:
#!/usr/bin/env python
# Usage: trim <url to shorten>
# A simple script that trims long urls using tr.im
# Requires the shorty library (http://github.com/joshthecoder/shorty-python).
# This script is public domain.
# Author: Joshua Roesslein
import sys
from shorty import Trim, ShortyError
#!/usr/bin/env python
import sys, os, time, atexit
from signal import SIGTERM
class Daemon:
"""
A generic daemon class.
Usage: subclass the Daemon class and override the run() method
define: func -> Func {
return func { printf("X is %d\n", 28) }
}
f: Func
f = define()
f()
Animal: class {
eat: func -> String { return "eating stuff" }
}
Bird: class extends Animal {
eat: func -> String { return "eating worms" }
}
main: func () {
diff --git a/gtk/Gtk.ooc b/gtk/Gtk.ooc
index 54679fd..a94890d 100644
--- a/gtk/Gtk.ooc
+++ b/gtk/Gtk.ooc
@@ -19,7 +19,7 @@ Gtk: cover {
/**
* Start the Gtk main loop
*/
- main: extern(gtk_main) static func
+ start: extern(gtk_main) static func
import threading/[Runnable, Thread]
MyRunnable: class extends Runnable {
run: func {
// do work here
}
}
t := Thread new(MyRunnable new())
t start()