Skip to content

Instantly share code, notes, and snippets.

View nhalstead's full-sized avatar
👨‍💻
Something. Maybe cool

Noah Halstead nhalstead

👨‍💻
Something. Maybe cool
View GitHub Profile
@roger-
roger- / main.cpp
Last active August 10, 2017 22:41
Part of RTSP server
/* ---------------------------------------------------------------------------
** This software is in the public domain, furnished "as is", without technical
** support, and with no warranty, express or implied, as to its usefulness for
** any purpose.
**
** main.cpp
**
** V4L2 RTSP streamer
**
** H264 capture using middleware_video
anonymous
anonymous / 254_PID_Example.c
Created January 12, 2017 01:26
An example implementation of a PID controller in RobotC for VEX.
#pragma config(Sensor, dgtl1, armEncoder, sensorQuadEncoder)
#pragma config(Motor, port1, armMotor, tmotorVex393_HBridge, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
#pragma platform(VEX2)
#pragma competitionControl(Competition)
#include "Vex_Competition_Includes.c"
//******************************************************************************
// 254_PID_Example.c
@peterdemartini
peterdemartini / command.sh
Last active March 6, 2025 07:29
Exclude node_modules in timemachine
find `pwd` -type d -maxdepth 3 -name 'node_modules' | xargs -n 1 tmutil addexclusion
@teknoraver
teknoraver / unixhttpc.go
Last active November 7, 2024 14:29
HTTP over Unix domain sockets in golang
package main
import (
"context"
"flag"
"fmt"
"io"
"net"
"net/http"
"os"
@cvan
cvan / capture.js
Created December 16, 2016 12:21
using CCapture.js to capture video of page (as a content script)
var script = document.createElement('script');
script.src = 'https://rawgit.com/spite/ccapture.js/master/build/CCapture.all.min.js';
script.addEventListener('load', function () {
// Create a capturer that exports a WebM video.
var capturer = new window.CCapture({format: 'webm'});
var capture = window.capture = function (canvas) {
var render = function () {
requestAnimationFrame(render);
// Rendering stuff…
capturer.capture(canvas);
@xbb
xbb / README
Last active May 7, 2025 20:26
IDRAC6 Virtual Console Launcher
Use this as an example on how to start the virtual console without the need of Java Web Start or accessing it from the web interface.
You can use the user and password that you use for the web interface.
You need an old JRE... I used 1.7.0_80 from the Server JRE package, also I have tested successfully 1.7.0_79 with MacOS.
You don't need to install it, just extract it or copy the files in "jre" folder.
Open the viewer.jnlp file that you get by launching the virtual console from the web interface with a text editor.
Note the urls to the jar files. Download the main jar file avctKVM.jar and the libs for your operating system and architecture.
Extract the dlls (.so Linux, .jnilib MacOS) from the jar libs.
@darekmydlarz
darekmydlarz / introrx.md
Created December 12, 2016 10:00 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
from lxml import etree
#http://stackoverflow.com/a/34084933
def get_deep_text(element):
try:
text = element.text or ''
for subelement in element:
text += get_deep_text(subelement)
text += element.tail or ''
return text
@markjaquith
markjaquith / suicidal-filter.php
Last active October 22, 2023 23:14
Version of `add_filter()` for WordPress that only runs once
<?php
/*
Use this just like `add_filter()`, and then run something that calls the filter (like
`new WP_Query`, maybe).
That's it. If the filter gets called again, your callback will not be.
This works around the common "filter sandwich" pattern where you have to remember to
call `remove_filter` again after your call.
// http://stackoverflow.com/a/5727346/3774582
// Parse CRON frequency
// Break it down like James Brown
function parse_crontab($time, $crontab) {
// Get current minute, hour, day, month, weekday
$time = explode(' ', date('i G j n w', strtotime($time)));
// Split crontab by space
$crontab = explode(' ', $crontab);
// Foreach part of crontab
foreach ($crontab as $k => &$v) {