Skip to content

Instantly share code, notes, and snippets.

@Jotschi
Jotschi / Cube.cpp
Created August 26, 2011 10:54
Cube CCP File
#include "Cube.h"
Cube::Cube() {}
Cube::~Cube() {}
void Cube::setSide(double s) {
side = s <= 0 ? 1 : s;
}
double Cube::getSide() {
@Jotschi
Jotschi / rpi_spi_eepromtest.c
Created September 6, 2012 19:16
Example program that write 1,2,3,4,5 to the 25LC010A eeprom chip.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <stdint.h>
#include <wiringPiSPI.h>
int main (void) {
int i ;
printf ("Raspberry Pi SPI 25LC010A program\n") ;
@Jotschi
Jotschi / gist:5555574
Last active December 17, 2015 05:09
Bus Pirate RFM70 SPI Arduino Data
CHECK: The RFM70 library sends this data
1. Select Bank 0
ATM: 5B [5C 07 0x07(0E 0x0E)5D ]
RPI: 5B [5C 07 0x07(0E 0x0E)5D ] - OK
?
ATM: 5B [5C 00 0x00(0E 0x0E)5D ]
#!/bin/bash
#
### BEGIN INIT INFO
# Provides: mysql-tmpfs
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Should-Start: $network $time
# Should-Stop: $network $time
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
#!/bin/bash
DATADIR=/opt/mysql/server-5.6/data/
echo -e "\n * Stopping mysql"
/etc/init.d/mysql stop
killall mysqld
killall -9 mysqld
echo "Done."
@Jotschi
Jotschi / mt.py
Last active August 29, 2015 13:58
#!/usr/bin/env python
from multiprocessing import Pool, Queue
import os
import time
q = Queue()
def worker_main():
print(os.getpid(),"working")

KitchenOffice Dummy

This is a dummy gist that kind of represents the data model that is being used in the KitchenOffice Webapp

Console

@Jotschi
Jotschi / tomcat7
Created August 6, 2014 11:47
Dynamic Debian Wheezy Tomcat 7 Init Script inspired by puppet configuration file https://raw.githubusercontent.com/example42/puppet-tomcat/master/templates/instance/init7-Debian.erb
#!/bin/sh
# /etc/init.d/tomcat7 -- startup script for the Tomcat 6 servlet engine
#
# Written by Miquel van Smoorenburg <[email protected]>.
# Modified for Debian GNU/Linux by Ian Murdock <[email protected]>.
# Modified for Tomcat by Stefan Gybas <[email protected]>.
# Modified for Tomcat6 by Thierry Carrez <[email protected]>.
# Modified for Tomcat7 by Ernesto Hernandez-Novich <[email protected]>.
# Additional improvements by Jason Brittain <[email protected]>.
#
import java.util.concurrent.CompletableFuture;
import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Label;
import org.neo4j.graphdb.Node;
import org.neo4j.graphdb.Relationship;
import org.neo4j.graphdb.ResourceIterable;
import org.neo4j.graphdb.Transaction;
import org.neo4j.graphdb.event.KernelEventHandler;
import org.neo4j.graphdb.event.TransactionEventHandler;
import static io.vertx.core.Vertx.vertx;
import io.vertx.core.AsyncResult;
import io.vertx.core.Handler;
import java.util.ArrayList;
import java.util.List;
import org.junit.Test;
public class AsyncTest {