Skip to content

Instantly share code, notes, and snippets.

Avatar

Ben Evans bencevans

View GitHub Profile
View cabal architecture.md

ARCHITECTURE

cabal clients
  cabal-core

cabal-core
  discovery-swarm
    dat-swarm-defaults
  kappa-view-level
  kappa-core
@maxogden
maxogden / bibtex.png
Last active Sep 13, 2021
How to make a scientific looking PDF from markdown (with bibliography)
@alirobe
alirobe / reclaimWindows10.ps1
Last active Oct 16, 2021
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
View reclaimWindows10.ps1
##########
# Tweaked Win10 Initial Setup Script
# Primary Author: Disassembler <disassembler@dasm.cz>
# Modified by: alirobe <alirobe@alirobe.com> based on my personal preferences.
# Version: 2.20.2, 2018-09-14
# Primary Author Source: https://github.com/Disassembler0/Win10-Initial-Setup-Script
# Tweaked Source: https://gist.github.com/alirobe/7f3b34ad89a159e6daa1/
# Tweak difference:
#
# @alirobe's version is a subset focused on safely disabling telemetry, some 'smart' features and 3rd party bloat ...
@maxogden
maxogden / readme.md
Last active Jun 30, 2021
ffmpeg youtube live event rtmp stream from raspberry pi with raspi camera (raspivid)
View readme.md
  1. compile ffmpeg for arm https://github.com/fiorix/ffmpeg-arm
  2. create youtube 'live event'. get rtmp url + session id
  3. run this:
raspivid -o - -t 0 -vf -hf -fps 30 -b 6000000 | ffmpeg -re -ar 44100 -ac 2 -acodec pcm_s16le -f s16le -ac 2 -i /dev/zero -f h264 -i - -vcodec copy -acodec aac -ab 128k -g 50 -strict experimental -f flv rtmp://a.rtmp.youtube.com/live2/<SESSION>

you can tweak -b and -fps to your liking. the settings above work well for 1080p. by not specifying width or height we get the full 1920x1080 resolution from the raspi camera

@JeffPaine
JeffPaine / i3-cheat-sheet.md
Last active Oct 3, 2021
i3 Window Manager Cheat Sheet
View i3-cheat-sheet.md

i3 Window Manager Cheat Sheet

$mod refers to the modifier key (alt by default)

General

  • startx i3 start i3 from command line
  • $mod+<Enter> open a terminal
  • $mod+d open dmenu (text based program launcher)
  • $mod+r resize mode ( or to leave resize mode)
  • $mod+shift+e exit i3
@jasonwhite
jasonwhite / joystick.c
Last active Aug 23, 2021
Reads joystick/gamepad events on Linux and displays them.
View joystick.c
/**
* Author: Jason White
*
* Description:
* Reads joystick/gamepad events and displays them.
*
* Compile:
* gcc joystick.c -o joystick
*
* Run:
@rowanmanning
rowanmanning / README.md
Created Jan 19, 2014
Example README for talk: "UX For Your Node Modules"
View README.md

Paddington

A small library for padding strings in JavaScript. Marmalade-free.

NOTE: PADDINGTON IS NO LONGER UNDER ACTIVE DEVELOPMENT.
If you're interested in maintaining Paddington, please get in touch via GitHub.

Current Version: 1.0.0

View output_or_adjust_current_master_volume.cpp
// to compile (using mingw-w64)
// g++ this_filename.c -lole32
// outputs current system volume (out of 0-100) to stdout, ex: output "23"
// mostly gleaned from examples here: http://msdn.microsoft.com/en-us/library/windows/desktop/dd370839(v=vs.85).aspx
// download a compiled version here:
// https://sourceforge.net/projects/mplayer-edl/files/adjust_get_current_system_volume_vista_plus.exe.exe (updated, can set it too now!)
#include <windows.h>
#include <commctrl.h>
#include <mmdeviceapi.h>
#include <endpointvolume.h>
@neumino
neumino / gist:7903626
Created Dec 11, 2013
@bencevans - Twitter - 2013/12/10
View gist:7903626
r.db("ScrobbleGraph").table("scrobbles").groupedMapReduce(
function(doc) { return doc("date").date() },
function(doc) { return [doc] },
function(left, right) { return left.add(right)}
)
// It's better to use just an orderBy and group on the client because
// - The database won't have to keep everything in memory
// - It's faster because of the index
@kendellfab
kendellfab / read_line.go
Created Nov 11, 2013
Golang --> Read file line by line.
View read_line.go
func readLine(path string) {
inFile, _ := os.Open(path)
defer inFile.Close()
scanner := bufio.NewScanner(inFile)
scanner.Split(bufio.ScanLines)
for scanner.Scan() {
fmt.Println(scanner.Text())
}
}