Skip to content

Instantly share code, notes, and snippets.

View zygm0nt's full-sized avatar
🥑
AFK

Marcin Cylke zygm0nt

🥑
AFK
View GitHub Profile
@vivekgalatage
vivekgalatage / Note Taking.md
Last active April 5, 2024 08:52
Note Taking details
@nikvdp
nikvdp / atuin.zsh
Created August 18, 2022 14:44
Use atuin to power ctrl-r history search but with fzf. Also disable atuin's up arrow bindings and use ctrl-e to bring up atuin's own tui
# make sure you have `tac` [1] (if on on macOS) and `atuin` [2] installed, then drop the below in your ~/.zshrc
#
# [1]: https://unix.stackexchange.com/questions/114041/how-can-i-get-the-tac-command-on-os-x
# [2]: https://github.com/ellie/atuin
atuin-setup() {
! hash atuin && return
bindkey '^E' _atuin_search_widget
export ATUIN_NOBIND="true"
@transientlunatic
transientlunatic / hexmap.tex
Last active April 29, 2021 20:56
Hexagons for map-making in the Traveller RPG
%
% x=3*(minimum size)/2
% x=\sqrt{3/4}*(minimum size)/2
%
\usetikzlibrary{shapes.geometric}
\usetikzlibrary{calc}
\def\hexdia{1cm}
@rkrzr
rkrzr / auto_tags.py
Last active August 14, 2024 16:36
Automatically generate ansible tags of the same name for each role in a playbook
"""
This module implements an Ansible plugin that is triggered at the start of a playbook.
The plugin dynamically generates a tag for each role. Each tag has the same name as its role.
The advantage of this is that it saves you some boilerplate, because you don't have to wrap
all tasks of a role in an additional block and assign a tag to that.
Additionally, it works automatically when you add new roles to your playbook.
Usage is exactly the same as without this plugin:
@serdroid
serdroid / gist:7bd7e171681aa17109e3f350abe97817
Created October 17, 2017 12:24
create commit and push to repo during CI build in gitlab
- generate ssh key for gitlab-runner user
- add ssh key to project's deploy keys (project/setting/repository)
add below commands into script section of .gitlab-ci.yml file.
# CI_REPOSITORY_URL contains gitlab-ci-token. replace start of the string up to '@' with git@' and append a ':' before first '/'
# example
# CI_REPOSITORY_URL=https://gitlab-ci-token:[email protected]/gitlab-examples/ci-debug-trace.git
# should be [email protected]:/gitlab-examples/ci-debug-trace.git
- export PUSH_REPO=$(echo "$CI_REPOSITORY_URL" | sed -e "s|.*@\(.*\)|git@\1|" -e "s|/|:/|" )
@rjurney
rjurney / apply.py
Created December 21, 2016 21:23
Plot a pyspark.RDD.histogram as a pyplot histogram (via bar)
%matplotlib inline
buckets = [-87.0, -15, 0, 30, 120]
rdd_histogram_data = ml_bucketized_features\
.select("ArrDelay")\
.rdd\
.flatMap(lambda x: x)\
.histogram(buckets)
create_hist(rdd_histogram_data)
@alirobe
alirobe / reclaimWindows10.ps1
Last active November 15, 2024 12:08
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
###
###
### UPDATE: For Win 11, I recommend using this tool in place of this script:
### https://christitus.com/windows-tool/
### https://github.com/ChrisTitusTech/winutil
### https://www.youtube.com/watch?v=6UQZ5oQg8XA
### iwr -useb https://christitus.com/win | iex
###
###
@Kornel
Kornel / recursive-cowsay.sh
Last active February 4, 2016 14:18
Recursive cowsay inception - random cow at every step
#!/usr/bin/env bash
COWS_PATH="/usr/local/share/cows"
COW_FILES=($(ls $COWS_PATH))
COWS=${#COW_FILES[@]}
rand_cow() {
#RAND_IDX=$(($RANDOM % $COWS))
RAND_IDX=$((`od -vAn -N4 -tu4 < /dev/urandom` % $COWS))
package spray.testkit
import org.specs2.execute.{ Failure, FailureException }
import org.specs2.specification.core.{ Fragments, SpecificationStructure }
import org.specs2.specification.create.DefaultFragmentFactory
trait Specs2Interface extends TestFrameworkInterface with SpecificationStructure {
def failTest(msg: String) = {
val trace = new Exception().getStackTrace.toList