Skip to content

Instantly share code, notes, and snippets.

View dbechrd's full-sized avatar

Dan Bechard dbechrd

View GitHub Profile
@dbechrd
dbechrd / Status.sh
Last active July 13, 2022 15:35
Check local vs. remote status of multiple repos
#!/usr/bin/env bash
###################################################################
# Author: Dan Bechard
# Date: May 9, 2013
# Desc: Displays status of all repositories in directory to allow
# the user to easily identify uncommited changes and pending
# commits on the remote.
#
# === CHANGELOGS ===
#
@dbechrd
dbechrd / BashPrintColor.sh
Last active August 29, 2015 14:02
Some helpful colored output functions that I use in my Git shell scripts on Windows.
CLR='\e[0m'
RED='\e[00;31m'
GREEN='\e[00;32m'
YELLOW='\e[00;33m'
BLUE='\e[00;34m'
PURPLE='\e[00;35m'
CYAN='\e[00;36m'
LIGHTGRAY='\e[00;37m'
@dbechrd
dbechrd / addcommas.c
Created April 11, 2017 19:39
Add commas to string of digits
#include <stdio.h>
#include <string.h>
// Cleanup: This is just for Rodney to see what's happening via printf()
void addCommas_debug(const char *num, char *buffer)
{
char temp[100] = {0};
int src = strlen(num) - 1;
int dst = 0;
@dbechrd
dbechrd / .screenrc-main-example
Last active September 20, 2017 02:54 — forked from ChrisWills/.screenrc-main-example
A nice default screenrc
# GNU Screen - main configuration file
# All other .screenrc files will source this file to inherit settings.
# Author: Christian Wills - cwills.sys@gmail.com
# Modified by: Dan Bechard dbechrd@gmail.com
# Allow bold colors - necessary for some reason
attrcolor b ".I"
# Tell screen how to set colors. AB = background, AF=foreground
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
@dbechrd
dbechrd / .vimrc
Created September 20, 2017 02:58
My .vimrc
" maximize window on start
if has("gui_running")
"set lines=999 columns=999
autocmd GUIEnter * simalt ~x
endif
set nocompatible " No vi compatibility
set autoindent " use autoindentation
set autoread " reload changed files automatically
set background=dark " colorscheme will assume dark background
@dbechrd
dbechrd / mustang.vim
Created September 20, 2017 03:00
My Vim colorscheme
" Maintainer: Henrique C. Alves (hcarvalhoalves@gmail.com)
" Version: 1.0
" Last Change: September 25 2008
set background=dark
hi clear
if exists("syntax_on")
syntax reset
@dbechrd
dbechrd / mg
Last active April 20, 2023 16:45
#!/bin/bash
DEBUG=0
VERBOSE=0
CMDS="args|b|br|co|db|nb|pb|pr|rbm|web"
BRANCH_PREFIX="dlb-"
BRANCH_URL_SAFE=""
REPO=`git remote -v | grep -m 1 "(push)" | sed -E "s/.*github\.com[:/](.*)(\.git| ).*/\1/"`
bool is_anagram(const char *str1, const char *str2)
{
int char_count[128] = { 0 };
int len = strlen(str1);
for (int i = 0; i < len; i++)
{
if (!str1[i] || !str2[i])
return false;
# Complete the climbingLeaderboard function below.
def climbingLeaderboard(scores, alice)
# Store Alice's position after each game
results = []
# Keep track of Alice's high score so far
alice_max = 0
# For each of Alice's scores
<div class="post-summary">
{{ with .Description }}
{{ (markdownify .) }}
{{ else }}
{{ ((delimit (findRE "(<.*?>(.|\n)*?</.*?>\\s*)+" .Content) "") | truncate (default 200 .Site.Params.summary_length) (default "" .Site.Params.text.truncated ) | replaceRE "&amp;" "&" | safeHTML) }}
{{ end }}
</div>