Skip to content

Instantly share code, notes, and snippets.

Avatar

Jon Watte jwatte

View GitHub Profile
@jwatte
jwatte / sluglibrary.errors
Created Sep 26, 2017
Trying to build sluglibrary on Ubuntu 17.04
View sluglibrary.errors
Trying to build on Ubuntu 17.04.
jwatte@ripper:~/Downloads/SlugDemo/Linux$ make
mkdir -p Output/Code
gcc -I../Code -I/usr/include -DSLUG_LINUX -DSLUG_OPENGL -m64 -msse -msse2 -std=c++11 -fno-exceptions -fno-rtti -Wall -Wno-multichar -Wno-strict-aliasing -Wno-unused-result -O3 -c ../Code/Main.cpp -o Output/Code/Main.o
gcc -I../Code -I/usr/include -DSLUG_LINUX -DSLUG_OPENGL -m64 -msse -msse2 -std=c++11 -fno-exceptions -fno-rtti -Wall -Wno-multichar -Wno-strict-aliasing -Wno-unused-result -O3 -c ../Code/SlugDemo.cpp -o Output/Code/SlugDemo.o
In file included from /usr/include/GL/glx.h:333:0,
from ../Code/SlugDemo.h:96,
from ../Code/Main.cpp:1:
/usr/include/GL/glxext.h:505:143: error: ‘GLintptr’ has not been declared
View Classes.hs
class A a where
getB :: B b => a -> b
class B b where
getA :: A a => b -> a
data X = X
instance A X where
getB x = x
View Example.hs
-- AUTO-GENERATED, DO NOT EDIT !!!
data CampaignTemplateMaybe = CampaignTemplateMaybe
{ maybe_name :: !(Maybe Text)
, maybe_kind :: !(Maybe Text)
, maybe_definition :: !(Maybe Text)
, maybe_saved :: !(Maybe Bool)
, maybe_hidden :: !(Maybe Bool)
, maybe_last_active :: !(Maybe UTCTime)
}
deriving (Show, Read, Ord, Eq)
@jwatte
jwatte / gist:5dd89b259eb3f42b54eb
Created Mar 6, 2015
soundstretch wrapper for extracting BMP from MP3
View gist:5dd89b259eb3f42b54eb
#!/bin/bash
trap "rm /var/tmp/foo.wav" EXIT
mpg123 -w /var/tmp/foo.wav "$1" >/dev/null 2>/dev/null
echo -n "$1 ; "
bpm=`soundstretch /var/tmp/foo.wav -bpm 2>&1 | grep "Detected BPM rate" | sed -e "s/Detected BPM rate //"`
echo "$bpm"
@jwatte
jwatte / example.csv
Last active Aug 29, 2015
IMVU CSV file data
View example.csv
We can make this file beautiful and searchable if this error is corrected: It looks like row 3 should actually have 1 column, instead of 3. in line 2.
Raw data:
=========
1,2,5\n
3,4,9
Expected:
2,3,7
@jwatte
jwatte / Display.cpp
Created Aug 16, 2014
Problem C++ file for Raspberry Pi
View Display.cpp
#include "All.h"
#include <VG/openvg.h>
#include <VG/vgu.h>
#include <EGL/egl.h>
#include <GLES2/gl2.h>
#include <bcm_host.h>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
@jwatte
jwatte / system-local.conf
Created Aug 3, 2014
system-local.conf in /etc/dbus-1
View system-local.conf
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-Bus Bus Configuration 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
<servicedir>/usr/local/src/voltmon</servicedir>
<policy user="root">
<allow eavesdrop="true"/>
<allow eavesdrop="true" send_destination="*"/>
</policy>
@jwatte
jwatte / net.watte.robots.voltmon.conf
Created Aug 3, 2014
net.watte.robots.voltmon.conf in /etc/dbus-1/system.d
View net.watte.robots.voltmon.conf
<!DOCTYPE busconfig PUBLIC
"-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
<policy context="default">
<allow own="net.watte.robots.voltmon"/>
<allow send_destination="net.watte.robots.voltmon"/>
<allow send_interface="net.watte.robots.voltmon"/>
</policy>
</busconfig>
@jwatte
jwatte / dbusvolt.py
Created Aug 3, 2014
dbusvolt.py module using dbus
View dbusvolt.py
import dbus
class DBusVolt(object):
def __init__(self):
self.bus = dbus.SystemBus()
self.svc = self.bus.get_object('net.watte.robots.voltmon', '/net/watte/robots/voltmon')
self.readfn = self.svc.get_dbus_method('read', 'net.watte.robots.voltmon')
self.offfn = self.svc.get_dbus_method('off', 'net.watte.robots.voltmon')
def read(self):
return self.readfn()
@jwatte
jwatte / voltservice.py
Created Aug 3, 2014
voltservice.py file using dbus
View voltservice.py
#!/usr/bin/python2
import gtk
import dbus
import dbus.service
import dbus.mainloop
import dbus.mainloop.glib
import spivolt
from dbus.mainloop.glib import DBusGMainLoop
You can’t perform that action at this time.