Skip to content

Instantly share code, notes, and snippets.

extern crate nng;
extern crate hidapi;
use hidapi::HidApi;
use std::os::raw::{c_int, c_char, c_void};
use std::ptr;
use std::ffi::CString;
use std::io::{self, Write};
use std::process::Command;
use std::os::raw::{c_int, c_char, c_void};
use std::ptr;
use std::ffi::CString;
use std::io::{self, Write};
#[repr(C)] // ensures that the memory layout of the struct is the same in Rust as in C.
pub struct obs_module_t {
pub mod_name: *mut c_char,
pub file: *const c_char,
pub bin_path: *mut c_char,
obs = obslua
source_name = ""
last_text = ""
time_format = ""
function set_time_text()
text = os.date(time_format)
if text ~= last_text then
obs = obslua
local bit = require("bit")
source_name = ""
function resize(pressed)
if not pressed then
return
end
-- haha you can only create sources in lua, python will never be allowed
-- because of its dumb global lock
obs = obslua
source_def = {}
source_def.id = "shitty_source"
source_def.output_flags = bit.bor(obs.OBS_SOURCE_VIDEO, obs.OBS_SOURCE_CUSTOM_DRAW)
source_def.get_name = function()
@DDRBoxman
DDRBoxman / minimal_vst2x_host.cpp
Created January 2, 2017 00:43 — forked from t-mat/minimal_vst2x_host.cpp
WIN32 : Minimal VST 2.x host in C++11.
// Win32 : Minimal VST 2.x Synth host in C++11.
//
// This is a simplified version of the following project by hotwatermorning :
// A sample VST Host Application for C++ Advent Calendar 2013 5th day.
// https://github.com/hotwatermorning/VstHostDemo
//
// Usage :
// 1. Compile & Run this program.
// 2. Select your VST Synth DLL.
// 3. Press QWERTY, ZXCV, etc.
func highlight(conn *irc.Conn, channel string, user string, line string, args []string) {
rconn := pool.Get()
defer rconn.Close()
if !isMod(rconn, channel, user) {
log.Printf("User %s tried to access !quote on %s add and wasn't a mod\n", user, channel)
return
}
c := channel[1:]
resp, err := twitchClient.GetChannelVideos(c, true, 1)
public class SigningClient implements Client {
final Client wrapped;
public SigningClient(Client client) {
wrapped = client;
}
@Override public Response execute(Request request) {
Request newRequest = sign(request);
return wrapped.execute(newRequest);
public class GameWispResponse<T> {
List<T> data;
Result result;
}
public class Result {
int status;
String message;
}
@DDRBoxman
DDRBoxman / scrapereps.py
Created February 16, 2016 05:57
Get the reps in Texas
import requests
from bs4 import BeautifulSoup
import unicodecsv as csv
r = requests.get("https://www.txdirectory.com/online/txsenate/")
c = r.content
soup = BeautifulSoup(c, "html.parser")
reps = []