Skip to content

Instantly share code, notes, and snippets.

View adventureloop's full-sized avatar

Tom Jones adventureloop

View GitHub Profile
@kruhft
kruhft / txtelite.c
Created April 10, 2012 00:48
txtelite port compilable on unix : gcc -o txtelite txtelite.c -lm
/* txtelite.c 1.4 */
/* Textual version of Elite trading (C implementation) */
/* Converted by Ian Bell from 6502 Elite sources.
Original 6502 Elite by Ian Bell & David Braben. */
/* Quick port to Linux/Unix systems by Burton Samograd <kruhft@gmail.com> */
/* Source: http://www.iancgbell.clara.net/elite/text/index.htm */
/* ----------------------------------------------------------------------
The nature of basic mechanisms used to generate the Elite socio-economic
universe are now widely known. A competant games programmer should be able to
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@tribut
tribut / mosh_pc.sh
Last active June 4, 2018 11:33
wrapper for mosh to work with ssh's proxycommand directive. this only makes sense if the target machine is directly reachable from the internet using udp (but probably not via tcp). usage: mosh_pc.sh [host as mentioned in .ssh/config] [public ip of host]
#!/bin/sh
# ########################################################## #
# wrapper for mosh to work with ssh's proxycommand directive #
# this only makes sense if the machine is directly reachable #
# from the internet using udp. #
# ########################################################## #
THISSCRIPT="`basename \"$0\"`"
REMOTE="$1"
local flux = require "flux"
function love.load()
text = { x = 350, y = 290, alpha = 0, str = "900 Tiny Squares" }
squares = {}
-- Title text
flux.to(text, 2, { alpha = 1 }):ease("linear")
:after(text, 2, { alpha = 0 }):ease("linear"):delay(3)
@bgamari
bgamari / test-ftdi.sh
Created July 18, 2014 15:43
A small script to test the pins of an FTDI JTAG adapter with OpenOCD
#!/bin/bash
cat >ftdi-test.cfg <<EOF
source [find interface/ftdi/dp_busblaster.cfg]
ftdi_layout_signal TCK -data 0x01
ftdi_layout_signal TDI -data 0x02
ftdi_layout_signal TDO -data 0x04
ftdi_layout_signal TMS -data 0x08
transport select jtag
@grugq
grugq / gist:03167bed45e774551155
Last active April 6, 2024 10:12
operational pgp - draft

Operational PGP

This is a guide on how to email securely.

There are many guides on how to install and use PGP to encrypt email. This is not one of them. This is a guide on secure communication using email with PGP encryption. If you are not familiar with PGP, please read another guide first. If you are comfortable using PGP to encrypt and decrypt emails, this guide will raise your security to the next level.

@xero
xero / irc.md
Last active July 10, 2024 12:09
irc cheat sheet

IRC Reference

Not intended as a guide for newbies, more like a "cheat sheet" for the somewhat experienced IRC user, especially one who wields some power over a channel.

The Basics

  • /join #channel
    • Joins the specified channel.
  • /part #channel
  • Leaves the specified channel.
@floe
floe / gst-appsrc.c
Last active April 3, 2023 12:11
example appsrc for gstreamer 1.0 with own mainloop & external buffers
// example appsrc for gstreamer 1.0 with own mainloop & external buffers. based on example from gstreamer docs.
// public domain, 2015 by Florian Echtler <floe@butterbrot.org>. compile with:
// gcc --std=c99 -Wall $(pkg-config --cflags gstreamer-1.0) -o gst-appsrc gst-appsrc.c $(pkg-config --libs gstreamer-1.0) -lgstapp-1.0
#include <gst/gst.h>
#include <gst/app/gstappsrc.h>
#include <stdint.h>
int want = 1;
@dominicgs
dominicgs / osmocom_spectrum_sense_flipdot.py
Last active August 29, 2015 14:27
Flipdot version of the osmocom_spectrum_sense (designed for MuCCC's UDP controller)
#!/usr/bin/env python
#
# Copyright 2005,2007,2011,2015 Free Software Foundation, Inc.
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# GNU Radio is distributed in the hope that it will be useful,
@DirkHeinke
DirkHeinke / gist:dfc14c8f0552212f1693
Last active August 21, 2021 14:05
gstreamer to twitch
# with sound and file
gst-launch-1.0 uridecodebin uri=file:///home/dirk/Videos/Clouds_67_Timelapse.mp4 ! video/x-raw,width=1280,height=720 ! queue ! x264enc threads=0 bitrate=400 tune=zerolatency key-int-max=30 ! queue ! flvmux name=flvmux ! queue ! rtmpsink location=rtmp://live-fra.twitch.tv/app/$APIKEY audiotestsrc ! faac ! flvmux.