Skip to content

Instantly share code, notes, and snippets.

View hauleth's full-sized avatar
⌨️
Click! Clack!

Łukasz Jan Niemier hauleth

⌨️
Click! Clack!
View GitHub Profile
@hauleth
hauleth / fix-fmt.sh
Last active November 10, 2017 12:21
#!/bin/sh
set -eo pipefail
in="$(mktemp)"
out="$(mktemp)"
trap "rm '$in' '$out'" EXIT
cat /dev/stdin > "$in"
"$@" < "$in" 2>/dev/null > "$out" && cat "$out" || cat "$in"
@hauleth
hauleth / asyncdo.vim
Created November 5, 2017 14:27
Minimal async runner
func! s:populate(file, cmd) abort
unlet! t:job
try
exe 'cgetfile '.a:file
finally
call setqflist([], 'a', {'title': a:cmd})
endtry
endfunc
func! AsyncDo(...) abort
@hauleth
hauleth / sudo_lecture
Created October 14, 2017 19:05
Sudo lecture
 ╓▄≡≡▄╖
 ╓▀ ⸜⏋⎾⸝ ▀╖
 ,▓⸜▚▃`´▃▞⸝▓,
 █  `⸜▀▀⸝´  █
 . ▓▐  ∕≡≡∖  ▌▓ .
 #⌉'╯ ║▌  ∣≡≡∣  ▐║ ╰'⌠#
 ¬"  ▐V  ▀▄_∕≡≡∖_▄▀ V▌ "⌐
 w╜ ▐▄ ,:« "▀▀▀▀" »:, ▄▌ ╙w
 ▐╖▄▄▄▄²▌^ ▐ ▌ ^▌²▄▄▄▄╓▌
 ▐╡W▐║ ▐  / ,, \  ▐ ║▌W╞▌
## Build
build:
stage: build
tags:
- elixir
script:
- eval $(ssh-agent -s)
- echo "$SSH_BUILD_KEY" | tr -d '\r' | ssh-add -
- git branch -f master HEAD
- mix edeliver build release --revision="$CI_BUILD_REF" --auto-version=revision
### Keybase proof
I hereby claim:
* I am hauleth on github.
* I am hauleth (https://keybase.io/hauleth) on keybase.
* I have a public key ASC0dZl_5-9qDXYdx41ee4Hg-qPbyRBmapJevdcVdwy5Rwo
To claim this, I am signing this object:
extern crate rayon;
extern crate regex;
extern crate scan_dir;
use rayon::prelude::*;
use regex::Regex;
use scan_dir::ScanDir;
use std::env;
use std::fs::File;
@hauleth
hauleth / -
Created September 14, 2015 14:47
fn witness(num: BigInt, a: BigInt, d: &BigInt, s: usize) -> Result {
let mut x = (&a).pow_mod(d, &num);
if x == one() || x == (&num - BigInt::one()) { return Result::Composite }
for _ in 0..s {
x = (&x * &x) % &num;
if x == one() { return Result::Composite }
if x == (&num - BigInt::one()) { return Result::PropablyPrime }
}
# Example answer file for setup-alpine script
# If you don't want to use a certain option, then comment it out
# Use US layout with US variant
KEYMAPOPTS="us us"
# Set hostname to alpine-test
HOSTNAMEOPTS="-n alpine"
# Contents of /etc/network/interfaces
# INSTALL INSTRUCTIONS: save as ~/.gdbinit
#
# DESCRIPTION: A user-friendly gdb configuration file, for x86/x86_64 and ARM platforms.
#
# REVISION : 8.0.5 (18/08/2013)
#
# CONTRIBUTORS: mammon_, elaine, pusillus, mong, zhang le, l0kit,
# truthix the cyberpunk, fG!, gln
#
# FEEDBACK: http://reverse.put.as - [email protected]
Fresh gcc v0.3.8
Fresh pkg-config v0.3.5
Fresh bitflags v0.3.0
Fresh libc v0.1.8
Fresh openssl-sys v0.6.3
Fresh libz-sys v0.1.6
Fresh curl-sys v0.1.24
Fresh libucl-sys v0.1.5
Fresh ucl v0.1.3 (file:///home/hauleth/Workspace/ucl-rs)
Running `/home/hauleth/Workspace/ucl-rs/target/debug/ucl-49bf07184c877340`