Skip to content

Instantly share code, notes, and snippets.

View bdlangton's full-sized avatar

Barrett Langton bdlangton

View GitHub Profile
@bcmiller
bcmiller / pre-commit
Created March 16, 2012 18:28
pre-commit
#!/bin/sh
# Place as .git/hooks/pre-commit
#Reject any commit that would have PHP syntaz errors on .php , .module, .install, .inc files
####
# Reject any commit that would add a line with tabs.
#
# You can enable this as a repo policy with
#
# git config hooks.allowtabs true
####
@MrMaksimize
MrMaksimize / commit-msg.sh
Created September 22, 2012 00:27
Commit message hook that appends story id
#!/bin/sh
#
# An example hook script to check the commit log message.
# Called by "git commit" with one argument, the name of the file
# that has the commit message. The hook should exit with non-zero
# status after issuing an appropriate message if it wants to stop the
# commit. The hook is allowed to edit the commit message file.
#
# To enable this hook, rename this file to "commit-msg".
@travist
travist / gist:1648952
Created January 20, 2012 18:45
Determine how productive your team has been using git history.
git log --shortstat --since="1 year ago" --until="now" \
| grep "files changed\|Author\|Merge:" \
| awk '{ \
if ($1 == "Author:") {\
currentUser = $2;\
}\
if ($2 == "files") {\
files[currentUser]+=$1;\
inserted[currentUser]+=$4;\
deleted[currentUser]+=$6;\
@fabiant7t
fabiant7t / s3_multipart_upload.py
Created April 17, 2011 14:54
Parallel S3 multipart upload with retries
import logging
import math
import mimetypes
from multiprocessing import Pool
import os
from boto.s3.connection import S3Connection
from filechunkio import FileChunkIO
@bdlangton
bdlangton / phpcs.txt
Last active May 27, 2022 00:49
phpcs config-set for Drupal using Coder module
# Basic default configs.
phpcs --config-set installed_paths ~/.composer/vendor/drupal/coder/coder_sniffer
phpcs --config-set default_standard Drupal
phpcs --config-set colors 1
# Show all errors.
phpcs --config-set error-severity 1
# Shows warnings, but doesn't return a non-zero return.
phpcs --config-set ignore_warnings_on_exit 1
@bdlangton
bdlangton / README.md
Last active June 1, 2022 19:13
Git hooks

Install required packages

Install the packages that you'll need. Drupal/coder includes phpcs. If you're not wanting to use a specific hook, then you don't need to install the associated packages.

composer global require drupal/coder phpmd/phpmd sebastian/phpcpd

Set path

Set the path in your shell startup script (ex: .zshrc or .bashrc).

@theaboutbox
theaboutbox / .ackrc
Created September 20, 2012 21:49
My .ackrc
--type-add=css=.sass,.less,.scss
--type-add=ruby=.rake,.rsel,.builder,.thor
--type-add=html=.haml,.html.erb,.html.haml
--type-add=js=.js.erb,.coffee
--type-set=cucumber=.feature
--type-set=c=.c,.cpp,.ino,.pde,.h
--ignore-dir=vendor
--ignore-dir=log
--ignore-dir=tmp
--ignore-dir=doc
# This is a blocklist to block samsung smart tv's sending meta data at home.
# Please help to collect domains!
# It could be that the TV does not receive any more updates or other services no longer work. Please report such an incident.
# https://gist.github.com/Perflyst/315f86393712a0c2107ee8eb58c6acee
0.0.0.0 device-metrics-us.amazon.com
0.0.0.0 samsungacr.com
0.0.0.0 samsungcloudsolution.com
0.0.0.0 samsungcloudsolution.net
0.0.0.0 pavv.co.kr
@p01
p01 / LICENSE.txt
Last active March 9, 2024 13:40 — forked from 140bytes/LICENSE.txt
Sudoku Solver in 140bytes
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Mathieu 'p01' Henri - http://www.p01.org/releases/
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
# GIT heart FZF
# -------------
is_in_git_repo() {
git rev-parse HEAD > /dev/null 2>&1
}
fzf-down() {
fzf --height 50% --min-height 20 --border --bind ctrl-/:toggle-preview "$@"
}