This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a condensed snippet of making a python daemon manually. | |
# grizzled and python-daemon were simply not working as easily as | |
# I would expect, while this little bit of code works just fine. | |
# Assumes you've already used an OptionParser instance to get | |
# some info but that's easily modified. | |
if options.daemon: | |
# Fork once | |
pid = os.fork() | |
if pid > 0: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stdio.h> | |
#include <string.h> | |
int main(int argc, char* argv[]) { | |
char *src="12345678"; | |
char dst1[10]; | |
char dst2[10]; | |
// ensure that dst is clean |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<style-scheme version="1.0" name="Zenburn"> | |
<style name="AddedLine" foreground="#708c80" background="#313c36" bold="true"/> | |
<style name="Comment" foreground="#7f9f7f"/> | |
<style name="CurrentLine" foreground="#dcdccc" background="#262626"/> | |
<style name="CurrentLineNumber" foreground="#9fafaf" bold="true"/> | |
<style name="DiffFile" foreground="#ecbcbc" background="#41363c" bold="true"/> | |
<style name="DiffLocation" foreground="#80d4aa" background="#2f2f2f" bold="true"/> | |
<style name="DisabledCode" background="#555555" bold="true"/> | |
<style name="Doxygen.Comment" foreground="#80969f"/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
sys.path.insert(0, '/job/HOME/ccollier/pycharm/pycharm-debug.egg') | |
from pydev import pydevd | |
pydevd.settrace('localhost', port=1234) | |
# HERE YOU WOULD CALL THE CODE BEING DEBUGGED. A BREAKPOINT SHOULD BE SET IN PYCHARM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
exec gnome-session --session xmonad "$@" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import akka.actor.ActorRef | |
import com.codahale.jerkson.Json.parse | |
import com.codahale.jerkson.ParsingException | |
import com.rabbitmq.client.{Channel, DefaultConsumer, Envelope} | |
import com.rabbitmq.client.AMQP.BasicProperties | |
class MsgConsumer(channel: Channel, target: ActorRef) extends DefaultConsumer(channel) { | |
override def handleDelivery(consumer_tag: String, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import play.api._ | |
import play.api.libs.concurrent.Akka | |
import akka.actor.Props | |
import akka.routing.SmallestMailboxRouter | |
import com.typesafe.config.ConfigFactory | |
// whatever your package name is and whatever interested actors you want to target | |
import myapplication.amqp.{RabbitMQConnection, MsgConsumer} | |
import myapplication.actors.EventFilter |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
if [ -d ".plant" ]; then | |
PROJECT=`basename $PWD` | |
COMMAND=$1 | |
OPTIONS=$@[2,${#}] | |
else | |
COMMAND=$1 | |
PROJECT=$2 | |
if [ -d $PROJECT ]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defclass viz-window (glut:window) | |
((zoom :initform 0.0025) | |
(offset :initform #(0.0 0.0)) | |
(last-mouse :initform ()) | |
(pan-throttle :initform 5) | |
(zoom-throttle :initform 0.00025) | |
(update-mode :initform nil)) | |
(:default-initargs :pos-x 100 :pos-y 100 | |
:width 800 :height 800 | |
:mode '(:double :rgba) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <qtoscsocket.h> | |
#include <QtCore/qbytearray.h> | |
#include <QtNetwork/qhostaddress.h> | |
QOSCSocket::QOSCSocket(QObject *parent) : QUdpSocket(parent) { | |
connect(this, &QUdpSocket::readyRead, | |
[=] () { | |
while(hasPendingDatagrams()) { | |
QByteArray datagram; |
OlderNewer