This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @see {@link http://tools.ietf.org/rfc/rfc4503.txt} | |
*/ | |
public class Rabbit { | |
private static final int[] A = new int[] { 0x4D34D34D, 0xD34D34D3, 0x34D34D34, 0x4D34D34D, 0xD34D34D3, 0x34D34D34, 0x4D34D34D, 0xD34D34D3 }; | |
private static final long MAX_UNSIGNED_INT = Integer.MAX_VALUE * 2l + 2; //2^32 | |
private static final boolean DEBUG = false; | |
private int[] X; | |
private int[] C; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Downloads the most popular subtitles for all episodes of one season of a TV series | |
# | |
# Flags: | |
# -s : define the season (required if 'u' is missing) | |
# -u : explicitly define the URL (required if 's' is missing) | |
# -l : define the language code ISO 639-1 (optional, default: sl) | |
# -e : define the episodes in a comma separated list (optional, default: all) | |
# -h : displays this message |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package dap.util; | |
import java.io.PrintStream; | |
/** | |
* The CLIProgressBar outputs a progress bar and the time remaining for completing a task. | |
* <p> | |
* To use it you must provide the total size / total number of iterations for your task (e.g. file length) | |
* and update the current position after each iteration. | |
* <p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.*; | |
import java.util.*; | |
/** The class encapsulates an implementation of the Apriori algorithm to compute frequent itemsets. | |
* | |
* This version uses multiple threads to go through the dataset and is therefore 3x faster than the 1 thread version. | |
* | |
* Notice: To enable progress tracking (CLIProgressBar) follow these steps: | |
* 1. download this class and put it on the classpath: https://gist.github.com/lovromazgon/9c801554ceb56157de30 | |
* 2. uncomment lines 229 and 243 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
FIRST_URL="http://learnyousomeerlang.com/introduction" | |
FOLDER="html" | |
OUTPUT_FILENAME="learnyousomeerlang.html" | |
mkdir $FOLDER | |
url=$FIRST_URL | |
i=1 | |
while true; do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
" => General | |
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
" Sets how many lines of history VIM has to remember | |
set history=500 | |
" Enable filetype plugins | |
filetype plugin on | |
filetype indent on |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package test | |
import ( | |
"github.com/trustmaster/goflow" | |
"fmt" | |
"testing" | |
"time" | |
) | |
// component 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name JIRA Hours Diff | |
// @namespace https://github.com/lovromazgon | |
// @version 0.2.3 | |
// @updateURL https://gist.github.com/lovromazgon/7f2589530a36a8f355b05c087a82ee37/raw | |
// @description Adds the information about required vs worked hours in Tempo.io | |
// @author Lovro Mažgon | |
// @match https://app.tempo.io/timesheets/jira/reports/* | |
// @grant none | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# with these functions you can have multiple gopath directories residing in /opt, where each gopath folder starts with "go-" | |
# when cd-ing to one of these directories (or any directory in them, on any level) the GOPATH gets changed automagically | |
function cd { | |
# call builtin cd. change to the new directory | |
builtin cd $@ | |
# call a hook function that can use the new working directory | |
# to decide what to do | |
set_gopath | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -euo pipefail # strict mode | |
currentSink() { pacmd list-sinks | awk '{if($1=="*"){print $3;}}'; } | |
inactiveSink() { pacmd list-sinks | awk '{if($1=="index:"){print $2;}}'; } | |
sinkInputs() { pacmd list-sink-inputs | awk '{if($1=="index:")print $2}'; } | |
current_sink="$(eval currentSink)" | |
inactive_sink="$(eval inactiveSink)" | |
sink_inputs="$(eval sinkInputs)" |
OlderNewer