Skip to content

Instantly share code, notes, and snippets.

View bdlangton's full-sized avatar

Barrett Langton bdlangton

View GitHub Profile
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 3, 2024 19:09
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@myusuf3
myusuf3 / delete_git_submodule.md
Created November 3, 2014 17:36
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
# 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 "$@"
}
@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
# 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
@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
@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).

@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
@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
@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;\