Skip to content

Instantly share code, notes, and snippets.

View voda's full-sized avatar

Ondřej Vodáček voda

  • Prague, Czech Republic
View GitHub Profile
[alias]
wip = !"git add -A; git ls-files --deleted -z | xargs -0 git rm; git commit -m \"wip\""
unwip = !"git log -n 1 | grep -q -c wip && git reset HEAD~1"
rb = !"git wip;git rebase -i origin/master;git unwip"
pr = !"git fetch;git wip;git rebase --stat origin;git unwip;git heads"
head = !"git log -n1"
lost = !"git fsck | awk '/dangling commit/ {print $3}' | git show --format='SHA1: %C(yellow)%h%Creset %f' --stdin | awk '/SHA1/ {sub(\"SHA1: \", \"\"); print}'"
heads = !"git log origin/master.. --format='%Cred%h%Creset;%C(yellow)%an%Creset;%H;%Cblue%f%Creset' | git name-rev --stdin --always --name-only | column -t -s';'"
@nojimage
nojimage / gearman-code-completion.php
Created September 16, 2011 05:10
pecl gearman classes code completion for NetBeans
<?php
/**
* for code completion
*
* @link http://docs.php.net/manual/en/book.gearman.php
*/
if (false) {
define('GEARMAN_SUCCESS', 0);
@shantanuo
shantanuo / dumper.pl
Created September 20, 2011 09:12
MySQLdump filter. Removes or replaces the DEFINER clauses from a dump
#!/usr/bin/perl
use strict;
use warnings;
use Getopt::Long qw(:config no_ignore_case );
my $replace = undef;
my $delete = undef;
my $help = 0;
GetOptions (
@sunils34
sunils34 / git_head_hash.sh
Created October 16, 2012 20:40
Get the first commit hash of a Git repository
#!/bin/sh
commit=`git log | grep commit | head -1 | cut -d ' ' -f2`
echo $commit
@wesleyit
wesleyit / crontab_header.sh
Created September 26, 2014 20:03
A default crontab header that will make the life easier for those who don't remember cron fields or keywords.
## CRONTAB HINTS AND TIPS
##
##
## Entry Description Equivalent To
## @yearly (or @annually) Run once a year at midnight in the morning of January 1 0 0 1 1 *
## @monthly Run once a month at midnight in the morning of the first of the month 0 0 1 * *
## @weekly Run once a week at midnight in the morning of Sunday 0 0 * * 0
## @daily Run once a day at midnight 0 0 * * *
## @hourly Run once an hour at the beginning of the hour 0 * * * *
## @reboot Run at startup @reboot
@Antnee
Antnee / password_hash_cost_calculator.php
Created February 29, 2016 13:48
PHP password_hash() cost calculator
<?php
/**
* Password Hash Cost Calculator
*
* Set the ideal time that you want a password_hash() call to take and this
* script will keep testing until it finds the ideal cost value and let you
* know what to set it to when it has finished
*/
// Milliseconds that a hash should take (ideally)
@SanderTheDragon
SanderTheDragon / postman-deb.sh
Last active July 25, 2024 08:22
A shellscript to create a Postman .deb file, for simple installation on Debian-based Linux distro's. Also creates a .desktop file.
#!/bin/sh
# SPDX-FileCopyrightText: 2017-2024 SanderTheDragon <sanderthedragon@zoho.com>
#
# SPDX-License-Identifier: MIT
arch=$(dpkg --print-architecture)
echo "Detected architecture: $arch"
case "$arch" in
@findepi
findepi / sort-commits-for-github.sh
Last active August 6, 2021 20:53
sort commits for GitHub's sake
git rebase "$(git merge-base HEAD master)" -x 'git commit --amend -C HEAD --date="$(date -R)" && sleep 1.05'