Skip to content

Instantly share code, notes, and snippets.

View seppestas's full-sized avatar

Seppe Stas seppestas

View GitHub Profile
@dexter93
dexter93 / bcm_iton.c
Last active June 22, 2023 05:46
Shaping it up
/*
Copyright 2021 Dimitris Mantzouranis <d3xter93@gmail.com>
This program 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 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@gene1wood
gene1wood / google-drive-symlink.md
Created September 19, 2017 19:36
Google Drive symlink
@gravitylow
gravitylow / codesign_gdb.md
Last active April 16, 2024 02:18 — forked from hlissner/codesign_gdb.md
Codesign gdb on macOS

If you are getting this in gdb on macOS while trying to run a program:

Unable to find Mach task port for process-id 57573: (os/kern) failure (0x5).
 (please check gdb is codesigned - see taskgated(8))
  1. Open Keychain Access
  2. In menu, open Keychain Access > Certificate Assistant > Create a certificate
  3. Give it a name (e.g. gdbc)
@cnlohr
cnlohr / htc_vive_watchman_codes
Last active June 22, 2017 19:40
HTC Vive Watchman Hacking Codes!
So, the way this goes is I post my AVR code, then I post what the HTC Vive does.
The output is: POST 0: (# of bytes) (IMU Timecode MSBs) (All raw light data)
(All raw light data ends with [3 bytes, LSB timecode] [OTA CRC (probably ignore)])
Events (TIME): (LED CODE 1)/(TIME CODE 1/TIMECODE 2)/(LED CODE 2)/(TIME CODE 3/TIMECODE 4)...
//NOTICE: The funky encoding of the numbers, and the fact that paramters are read from the end of the data going forward.
//We know we're done when the # of parameters read is (# of bytes left*2)-1
@cabo
cabo / crlf.screenrc
Created December 19, 2015 13:33
Make GNU screen convert return key (CR) into CR-LF
# put this in your ~/.screenrc to make
# ^A D (uppercase) switch on, and
# ^A U (uppercase) switch off, converting
# CR (return keys) input into CRLF
bind D bindkey "\015" stuff "\015\012"
bind U bindkey "\015" stuff "\015"
@jinman
jinman / gist:75367fc8466753ccbe45
Last active August 2, 2016 19:15
LambdaToIoTHTTP
var aws = require('aws-sdk');
var iot = = new AWS.Iot();
var iotData = = new AWS.IotData();
exports.handler = function(event, context) {
// Exercising an IoT Data operation as an example
var params = {
"topic" : "foo/bar",
"payload" : "hello world"
@sindresorhus
sindresorhus / post-merge
Last active May 2, 2024 03:18
git hook to run a command after `git pull` if a specified file was changed.In this example it's used to run `npm install` if package.json changed and `bower install` if `bower.json` changed.Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
#!/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
@brendannee
brendannee / gist:5400591
Last active April 21, 2022 08:56
Restart chromium via SSH
# stop chromium
sudo killall chromium
# manually set the display to one that is currently being used
# start chromium in kiosk mode with the URL we want to load
# use nohup so it stays up after we disconnect
DISPLAY=:0 nohup chromium --kiosk --incognito bart.blinktag.com/?station=16TH &
@thbar
thbar / how-to-diff-pdf-files-with-git-and-diffpdf.md
Last active November 3, 2023 06:01
How to diff PDF files with Git

One can use MD5 or plain text diff to see differences in PDF files. If that's not enough, here's how to use diff-pdf which knows how to diff based on appearance or words:

  • brew install diff-pdf
  • edit your ~/.gitconfig to add this:
[difftool "diffpdf"]
  cmd = diff-pdf --view \"$LOCAL\" \"$REMOTE\"
@alotaiba
alotaiba / google_speech2text.md
Created February 3, 2012 13:20
Google Speech To Text API

Google Speech To Text API

Base URL: https://www.google.com/speech-api/v1/recognize
It accepts POST requests with voice file encoded in FLAC format, and query parameters for control.

Query Parameters

client
The client's name you're connecting from. For spoofing purposes, let's use chromium

lang
Speech language, for example, ar-QA for Qatari Arabic, or en-US for U.S. English