Skip to content

Instantly share code, notes, and snippets.

Avatar

sarnobat

View GitHub Profile
View AtlassianBannerRemove.user.js
// ==UserScript==
// @name testName
// @namespace anonDeveloper
// @description This script will automagically blah blah blah
// @include *
// @match https://*/jira/browse
// ==/UserScript==
// See private file for otheradditions
View toc.js
<script
src="https://code.jquery.com/jquery-1.9.1.min.js"
integrity="sha256-wS9gmOZBqsqWxgIVgA8Y9WcQOa7PgSIX+rPA0VL2rbQ="
crossorigin="anonymous"></script>
<script src="https://ndabas.github.io/toc/lib/jquery.toc/jquery.toc.js" type="text/javascript"></script>
<ul data-toc data-toc-headings="h2,h3,h4,h5"></ul>
@sarnobat
sarnobat / recruiters.txt
Last active Nov 9, 2020
Domains you can filter out to combat spam and unsolicited approaches
View recruiters.txt
# Separate lines because GMail has a length limit
22ndstaffing OR abcscorp OR accurogroup OR acsicorp OR adroitresources OR adventglobal OR aesinc OR ageatiainc OR agreeya OR akraya OR alchemysolutions OR aloisstaffing OR amiseq OR ampcus OR apninc OR apolisrises OR applabsystems OR aptask OR arnamy OR askstaffing OR astiusa OR atsolutions OR avaconsulting OR axelon OR axiustek OR bayonesolutions OR bereangroup OR bullseyehires OR calibrocorp OR catstaffing-us OR chenoainc OR clearbridgetech OR compuvis OR consultingknights OR contech-it OR crossfireconsulting OR cynetsystems OR datapipertech OR deegit OR dewsoftware OR digitaldhara OR diverselynx OR eateam OR enterprisesolutioninc OR epchelp OR epro-consulting OR erostechnologies OR e-solutionsinc OR evergreentechnologies OR experis OR first-tek OR flextoninc OR fusionitinc OR ghktech OR gisbiztech OR gitallc OR greatlogicsinc OR gttit OR hanstaffing OR healthcarepartners OR hireitpeople OR honorvettech OR horizontalintegration OR ibainfotech OR iconsultus
View stdin2multimap.java
import java.io.*;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;
public class Graphml2FileSystemStdin {
public static void main(String[] args) {
Multimap<String, String> parentToChildren = HashMultimap.create();
@sarnobat
sarnobat / Stdin.java
Last active Aug 28, 2018
Java command line program that loops over stdin
View Stdin.java
import java.io.*;
public class StdinLoop {
public static void main(String[] args) {
BufferedReader br = null;
try {
br = new BufferedReader(new InputStreamReader(System.in));
String line;
while ((line = br.readLine()) != null) {
@sarnobat
sarnobat / url_param.js
Last active Sep 30, 2017
Get and Set URL parameter in javascript
View url_param.js
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/purl/2.3.1/purl.js"></script>
<script>
// Get the URL parameter
var argName = $.url().param('argName');
// Set the URL parameter
if (argName == null) {
history.pushState(null, null, '/?argName=defaultValue');
}
@sarnobat
sarnobat / bindkey_multiline.zsh
Last active Sep 27, 2017
ZSH key binding that spans multiple lines
View bindkey_multiline.zsh
bindkey -s "^[T" 'sh <<EOF ^[^M'\
'^[^M'\
' # Run the main test.^[^M'\
' cd ~/work/src/tests/ && JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home mvn --quiet test --settings ~/sarnobat.git/mac/.m2/settings.xml -Dsurefire.useFile=false -Dsurefire.printSummary=false -Dtier=devint -Dtest="*#*" | grcat ~/conf.tail ; popd; osascript -e '\''tell app \"System Events\" to display dialog \"Tests finished\"'\'' ^[^M'\
'^[^M'\
'EOF'\
'^[[A^[[A^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D'
@sarnobat
sarnobat / .bashrc.keys.sh
Last active Sep 25, 2017
Key binding equivalents between Bash and Zsh
View .bashrc.keys.sh
# bash
bind '"\el":"ls -lrtha --color=always\n"'
bind '"\ef":"find $PWD -type f -iname \"**\""'
bind '"\eg":"| xargs grep --delimiter \"\\n\" grep --color=always -ni \"*\""'
bind '"\e[1;3D": backward-word'
bind '"\e[1;3C": forward-word'
bind '"\e[1;3A": history-search-backward'
bind '"\e[1;3B": history-search-forward'
bind '"\ep":"pwd\n"'
bind '"\e4"':yank-last-arg
View Bourne shell iterate over stdin.sh
while read line
do
echo "$line"
done < "${1:-/dev/stdin}"