This file contains hidden or 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 | |
function phpunit_exists() { | |
if [ -f bin/phpunit ] || [ -f vendor/bin/phpunit ]; then | |
return 0 | |
else | |
return 1 | |
fi |
This file contains hidden or 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 | |
# Example: | |
# jira_issue_number=$(extract_jira_issue_number_from_string "nikodem/ABC-123-test") | |
# ABC-123 | |
extract_jira_issue_number_from_string() { | |
local input="$1" | |
local issue_number=$(rg -o '\b[A-Za-z]{2,5}-\d+\b' <<< "$input") | |
if [ -z "$issue_number" ]; then |
This file contains hidden or 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
Example output: | |
❯ git-diff-log 5583981737b4c05ca429b3f62dd0023479c75fde | |
* Add verbosity and non-verbosity to command output cd328f1 | |
* Share HTTP request error handling between conversion currency methods 5d6e795 | |
* Add error handling to FIAT currency converter after NBP API issues 5fd68e4 | |
* Remove unused get_current_coinbase_rate function 449b971 | |
* Define return types for methods in Wallet class eb6c67a |
This file contains hidden or 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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <errno.h> | |
#include <arpa/inet.h> | |
#include <unistd.h> | |
#include <netinet/tcp.h> | |
int main(int argc, const char *argv[]) | |
{ |
This file contains hidden or 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 | |
# Credits for the idea to https://djs55.github.io/jekyll/update/2017/11/27/docker-for-mac-disk-space.html | |
get_size () { | |
ls -alks $HOME/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/Docker.raw | awk '{print $1}' | |
} | |
reclaim_space () { | |
docker run --rm -it --privileged --pid=host walkerlee/nsenter -t 1 -m -u -i -n fstrim /var/lib/docker | |
} |
This file contains hidden or 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
/* From Paul Irish */ | |
/* instead of */ | |
setInterval(function(){ doAsyncStuff(); },100); | |
/* use anonymous self-executing async function */ | |
(function thisismyfunctionuniquename () { | |
$("#update").load("mypage.aspx",function () { | |
setTimeout(thisismyfunctionuniquename, 100); |
This file contains hidden or 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
/* global $, module, require, window, console, alert, confirm */ | |
var _ = require('underscore'); | |
module.exports = (function () { | |
'use strict'; | |
/** | |
* @private | |
* @type {boolean} | |
*/ |