Skip to content

Instantly share code, notes, and snippets.

View damiann's full-sized avatar
🏴
Ę̮̱͔͓ͯ͗ͫ̌̏ͫ͌́x̘̤͚̰̫̫̗̤̱̒̓ͨͯ͑̓ͥͫ̕å̰͚̓͒ͫm̛̤͕̫̳̺̩̄̓ͨͥ͜ͅp̰͉͗ͤl̵̖̗̫͍͓͋̍̐͌̐̒e̡̧̿͒͋̈́͡

Damian damiann

🏴
Ę̮̱͔͓ͯ͗ͫ̌̏ͫ͌́x̘̤͚̰̫̫̗̤̱̒̓ͨͯ͑̓ͥͫ̕å̰͚̓͒ͫm̛̤͕̫̳̺̩̄̓ͨͥ͜ͅp̰͉͗ͤl̵̖̗̫͍͓͋̍̐͌̐̒e̡̧̿͒͋̈́͡
View GitHub Profile
@damiann
damiann / alias_matchers.md
Created February 1, 2021 22:55 — forked from JunichiIto/alias_matchers.md
List of alias matchers in RSpec 3

This list is based on aliases_spec.rb.

You can see also Module: RSpec::Matchers API.

matcher aliased to description
a_truthy_value be_truthy a truthy value
a_falsey_value be_falsey a falsey value
be_falsy be_falsey be falsy
a_falsy_value be_falsey a falsy value
def install_missing_gems(&block)
yield
rescue LoadError => e
gem_name = e.message.split('--').last.strip
install_command = 'gem install ' + gem_name
system(install_command) or exit(1)
Gem.clear_paths
require gem_name
retry
@damiann
damiann / gist:fd94da2f6259b0d73df1c97bb3292d0a
Created February 26, 2018 23:53
Remove all docker containers with given name
docker ps -a | awk '{ print $1,$2 }' | grep name_of_fed_up_container | awk '{print $1 }' | xargs -I {} docker rm {}
@damiann
damiann / gist:3a087a041e4ae2f8fb20ac4eefc38eb1
Created April 11, 2017 19:55
Rerun terminal command multiple times
cmd="..some command..."; for i in $(seq 5); do $cmd; sleep 1; done

Keybase proof

I hereby claim:

  • I am damiann on github.
  • I am damiann (https://keybase.io/damiann) on keybase.
  • I have a public key whose fingerprint is C48C 19E5 A7C3 24D2 6402 9065 1682 296F B347 7DE0

To claim this, I am signing this object:

@damiann
damiann / gist:84adad982e71fbb510b95e482064a0e4
Created July 11, 2016 02:32
Random Generated Background
<p style="line-height: 18px; font-size: 18px; font-family: times;">
<script>
for (var line=1; line<60; line++) {
for(var i=1;i<29;i++) {
var s = (Math.floor((Math.random()*2)%2)) ? "╱" : "╲";
document.write(s);
}
document.writeln("<br>");
}
@damiann
damiann / gist:dac6857601f48de6c3e87c90f1d09c12
Created July 11, 2016 02:32
Random Generated Background
<p style="line-height: 18px; font-size: 18px; font-family: times;">
<script>
for (var line=1; line<60; line++) {
for(var i=1;i<29;i++) {
var s = (Math.floor((Math.random()*2)%2)) ? "╱" : "╲";
document.write(s);
}
document.writeln("<br>");
}
@damiann
damiann / face_replace.py
Created January 6, 2016 21:03 — forked from robertskmiles/face_replace.py
A script to automatically replace faces in group photos
#!/usr/bin/python
# face_replace.py
# Usage: python face_replace.py <image_file> [face index]
import sys
from opencv.cv import *
from opencv.highgui import *
from PIL import Image, ImageEnhance
import random
<?php
echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8">';
function get_fname($string, $sub) {
$bad = array("<", ">", ":", '"', "/", "\\", "|", "?", "*");
$name = str_replace($bad, "_", $string);
echo strlen(utf8_decode($string));
if (strlen($string) > $sub) {
$name = mb_substr($string,0,$sub, "utf-8");
}
@damiann
damiann / log4j.xml
Created October 11, 2014 02:03
Complex Example
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="FATAL">
<Properties>
<Property name="filename">/logs/error.log</Property>
<Property name="console-pattern">%m%n</Property>
<Property name="file-pattern">%d %p %t %c - %m%n</Property>
<Property name="smtp-ip">127.0.0.1</Property>
<Property name="smtp-user">test</Property>
<Property name="smtp-pass">test</Property>
<Property name="smtp-to">test@test.com</Property>