Skip to content

Instantly share code, notes, and snippets.

doc = nlp("the drawdown process is governed by astm standard d823")
for tok in doc:
print(tok.text, "...", tok.dep_)
@hellricer
hellricer / devtools.py
Created May 29, 2019 09:39
ELinks hooks providing a framework for manipulating DOM
import os
import re
import subprocess
from bs4 import BeautifulSoup
import rules
def replacer(url, html):
new = html
reload(rules)
@mdawaffe
mdawaffe / diff-changed-lines.sh
Last active March 25, 2025 11:24
Get line numbers of changed lines - git, diff - Full of bashisms
#!/bin/bash
# Call like you would `diff`
# `./diff-changed-lines.sh old new`
# Outputs the lines numbers of the new file
# that are not present in the old file.
# That is, outputs line numbers for new lines and changed lines
# and does not output line numbers deleted or unchanged lines.
#!/usr/bin/env runhaskell
-- Copyright (C) 2018 Daniel Gröber <[email protected]>
--
-- Copying and distribution of this file, with or without modification,
-- are permitted in any medium without royalty provided the copyright
-- notice and this notice are preserved. This file is offered as-is,
-- without any warranty.
{-|
License: GNU All-Permissive License
@mcastelino
mcastelino / rawsocket.md
Created April 5, 2018 19:04
Raw Sockets debugging

How to track raw sockets

Example program

Say a program has opened a raw socket. How do you know it has it open

+       int sock_r;
+       struct ifreq ifrr;
+ size_t if_name_len=strlen("dummy0");
@evantoli
evantoli / GitConfigHttpProxy.md
Last active November 2, 2025 09:57
Configure Git to use a proxy

Configure Git to use a proxy

In Brief

You may need to configure a proxy server if you're having trouble cloning or fetching from a remote repository or getting an error like unable to access '...' Couldn't resolve host '...'.

Consider something like:

@Fusl
Fusl / gist:3a708b8c32c9d5264fa0
Last active September 21, 2025 01:15
Streaming audio output from Linux (Pulseaudio) to Windows
# Windows (receiver) side:
.\ffplay.exe -nodisp -ac 2 -acodec pcm_u8 -ar 48000 -analyzeduration 0 -probesize 32 -f u8 -i udp://0.0.0.0:18181?listen=1
# Linux (transmitter) side:
pactl load-module module-null-sink sink_name=remote
ffmpeg -f pulse -i "remote.monitor" -ac 2 -acodec pcm_u8 -ar 48000 -f u8 "udp://RECEIVER:18181"
pavucontrol # Change the default output to the Null sink or move single applications to this "output" device.
@michael-k
michael-k / git-lfs-diff.sh
Created June 26, 2015 10:22
Git LFS Diff
#!/bin/sh
if [ $# -ne 3 ] ; then
echo "Usage: $0 <ref> <ref> <filename>"
exit 1
fi
RevA=$1
RevB=$2
File=$3
@PuKoren
PuKoren / recompile-and-run.sh
Last active May 31, 2024 15:18
Recompile APK + Sign with apktool
# You must first install apktool (https://github.com/iBotPeaches/Apktool) and android SDK
# and decompile apk using it
# apktool d -rf my-app.apk
# then generate a key for sign in:
# keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
rm signed-app.apk
apktool b -f -d com.myapp
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore com.myapp/dist/com.myapp.apk alias_name
zipalign -v 4 com.myapp/dist/com.myapp.apk signed-app.apk
@diorahman
diorahman / linux-kernel-make-menuconfig-yosemite.md
Last active April 28, 2025 17:57
Run linux kernel make menuconfig on osx yosemite

osx

install ncurses, via $ brew install ncurses

edit the scripts/kconfig/Makefile, put HOSTLOADLIBES_mconf += -L/usr/local/opt/ncurses/lib -ltinfo, where the libtinfo.dylib is just a symlink to libncurses.dylib

hit the scripts/kconfig/lxdialog/check-lxdialog.sh, this is ugly!

#!/bin/sh