Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` or `git checkout` if a specified file was changed
# Run `chmod +x post-checkout` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id HEAD@{1} HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && echo " * changes detected in $1" && echo " * running $2" && eval "$2"
@sfabijanski
sfabijanski / post-merge
Last active June 24, 2016 19:01 — forked from mariusGundersen/post-checkout
Save the post-merge file to the .git/hooks directory inside the repository folder. After each 'git pull' it will run 'npm install' if necessary and build the client files.
#!/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` or `git checkout` if a specified file was changed
# Run `chmod +x post-checkout` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id HEAD@{1} HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && echo " * changes detected in $1" && echo " * running $2" && eval "$2"
@sfabijanski
sfabijanski / 01-synaptics.conf
Last active November 6, 2015 14:54
Synaptics setup for T440S
# /etc/X11/xorg.conf.d/01-synaptics.conf
# use case: I never use middle click. I want the entire clickpad
# available for mouse movements and don't need the secondary buttons for right click.
# I trigger right-clicks with two fingered clicks and use two-fingered scrolling.
# I need to prevent my palm from making the cursor jump around when typing
Section "InputClass"
Identifier "t440 top buttons"
MatchDriver "synaptics"
# turn of all SoftButton Areas explicitly
Option "SoftButtonAreas" " 0 0 0 0 0 0 0 0"
@sfabijanski
sfabijanski / cntlm_setup.md
Last active June 25, 2020 08:03
Installing and settng up cntlm to work behind an NTLMv2 corporate proxy

Some web proxies use NTLMv2 authentication to pass user domain credentials to the proxy before accessing the internet. A number of the command line tools (npm, bower, curl) need to have their proxy configurations set and don't handle the NTLM handoff well. Installing and configuring the tools to use cntlm.exe as a local proxy alleviates the problem.

Requirements

  • cntlm.exe
  • git for windows ( with gitBash )
@sfabijanski
sfabijanski / esrislurp.js
Last active August 29, 2015 14:23
Esrislurp example that runs to completion on newer versions of Node. Addition of new http agent with `keepalive: true` to keep the socket pool open for reuse
/*
* esrislurp
* https://github.com/steveoh/esrislurp
*
* Copyright (c) 2014 steveoh
* Licensed under the MIT license.
*/
'use strict';
var fs = require('fs'),