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 October 4, 2023 08:38
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 <dxld@darkboxed.org>
--
-- 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");
@kuznero
kuznero / nixos-install.md
Last active June 21, 2023 22:34
Installing NixOS behind corporate proxy

In order to install NixOS behind corporate proxy do the usual stuff but before running nixos-install set this environment variable:

export CURL_NIX_FLAGS="-x http://user:password@proxy:port/"

In addition in case you have ties to cloning from GitHub (like vim plugins), you should export proxy related variables:

export HTTP_PROXY=http://user:password@proxy:port/
@evantoli
evantoli / GitConfigHttpProxy.md
Last active June 19, 2024 00:17
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 June 30, 2024 17:48
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