Skip to content

Instantly share code, notes, and snippets.

View ibrasho's full-sized avatar
📭
Un-contained

Ibrahim AshShohail ibrasho

📭
Un-contained
View GitHub Profile
#!/usr/bin/sh
# git-distance-based SEMVER
#
# Optional Flag: -t to cause the script to actually tag the github repo
# Using -t will cause the original behavior of Jerry's version.
# Not using -t will not touch the github repo or tags. Just will set the VERSION output and VERSION file
#
# Optional Argument: path to VERSION file. Defaults to VERSION in the current director
# major and minor, once released, are designated by add RELEASE-vx.y tag and the patch will be derived based on distance to that tag
@ibrasho
ibrasho / cloudSettings
Last active July 3, 2019 20:25
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-07-03T20:21:49.816Z","extensionVersion":"v3.3.1"}
@martinbean
martinbean / pre-commit
Last active December 19, 2023 22:14
Pre-commit hook to detect if any .php files contain dd()
#!/usr/bin/php
<?php
$files = shell_exec('git diff-index --name-only --cached --diff-filter=ACMR HEAD | grep "\.php$"');
$files = explode("\n", trim($files));
$exitCode = 0;
foreach ($files as $file) {
if (empty($file)) {
#!/bin/bash
# remove exited containers:
docker ps --filter status=dead --filter status=exited -aq | xargs -r docker rm -v
# remove unused images:
docker images --no-trunc | grep '<none>' | awk '{ print $3 }' | xargs -r docker rmi
# remove unused volumes:
find '/var/lib/docker/volumes/' -mindepth 1 -maxdepth 1 -type d | grep -vFf <(
@raboof
raboof / .ctags
Last active November 8, 2019 12:40
--fields=+l
--verbose=no
--recurse=yes
--tag-relative=yes
--tag-relative=yes
--exclude=target
--exclude=.git
--langdef=scala
--langmap=scala:.scala
--regex-scala=/^[ \t]*((abstract|final|sealed|implicit|lazy)[ \t]*)*(private|protected)?[ \t]*class[ \t]+([a-zA-Z0-9_]+)/\4/c,classes/
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs