Skip to content

Instantly share code, notes, and snippets.

View sdomi's full-sized avatar
💽
I Hate The New New GitHub UI

Dominique Liberda sdomi

💽
I Hate The New New GitHub UI
View GitHub Profile
#!/usr/bin/awk -f
# This program is a copy of guff, a plot device. https://github.com/silentbicycle/guff
# My copy here is written in awk instead of C, has no compelling benefit.
# Public domain. @thingskatedid
# Run as awk -v x=xyz ... or env variables for stuff?
# Assumptions: the data is evenly spaced along the x-axis
# TODO: moving average
@dideler
dideler / bot.rb
Last active April 10, 2024 18:19
Sending a notification message to Telegram using its HTTP API via cURL
# Use this script to test that your Telegram bot works.
#
# Install the dependency
#
# $ gem install telegram_bot
#
# Run the bot
#
# $ ruby bot.rb
#
@mattlewissf
mattlewissf / add-p.md
Last active March 24, 2024 07:39
Lightning Talk: Git add -p

git add -p is your friend

git add -p is basically "git add partial (or patch)"

Patch mode allows you to stage parts of a changed file, instead of the entire file. This allows you to make concise, well-crafted commits that make for an easier to read history. This feature can improve the quality of the commits. It also makes it easy to remove parts of the changes in a file that were only there for debugging purposes - prior to the commit without having to go back to the editor.

It allows you to see the changes (delta) to the code that you are trying to add, and lets you add them (or not) separately from each other using an interactive prompt. Here's how to use it:

from the command line, either use

  • git add -p
@tzermias
tzermias / ip_forward.md
Last active March 20, 2024 02:06
Forward traffic from wlan0 to eth0 interface

Forward traffic from a laptop's eth0 to wlan0

###To laptop

Specify an IP address to eth0 (here 192.168.56.1)

sudo ifconfig eth0 192.168.56.1 netmask 255.255.255.0

Advanced Recursive Diffing™

Ever needed to diff two trees of files, while doing some preprocessing on modified files? Well - we've got a solution for you. Or rather... our long friend git has.

Turns out it's perfectly legal to just use git diff --no-index on directories outside of (any) git repository. With that, we can (ab-)use built in git diff per-path/extension preprocessing feature.

Using the fs-net libtransistor fork

This guide assumes you are already familliar with setting up RetroArch with libtransistor.

Clone the fs-net branch from https://github.com/davidbuchanan314/libtransistor:

git clone https://github.com/davidbuchanan314/libtransistor --recursive -b fs-net

Build libtransistor as usual.