Skip to content

Instantly share code, notes, and snippets.

View wagoodman's full-sized avatar
🤓

Alex Goodman wagoodman

🤓
View GitHub Profile
@j8
j8 / git_empty_branch
Created February 14, 2014 08:32
Create new branch with empty folder structure
You can create a new empty branch like this:
$ git checkout --orphan NEWBRANCH
--orphan creates a new branch, but it starts without any commit. After running the above command you are on a new branch "NEWBRANCH", and the first commit you create from this state will start a new history without any ancestry.
The --orphan command keeps the index and the working tree files intact in order to make it convenient for creating a new history whose trees resemble the ones from the original branch.
Since you want to create a new empty branch that has nothing to do with the original branch, you can delete all files in the new working directory:
@miki725
miki725 / .bash_prompt.sh
Last active April 2, 2025 13:32
Custom bash prompt which displays: (virtualenv) user:/path (git-branch)
#!/bin/bash
#
# DESCRIPTION:
#
# Set the bash prompt according to:
# * the active virtualenv
# * the branch of the current git/mercurial repository
# * the return value of the previous command
# * the fact you just came from Windows and are used to having newlines in
# your prompts.
@fbrnc
fbrnc / gist:8ed33626f2fdeb4507df
Created August 13, 2014 03:27
Install Chef and Berkshelf on Ubuntu
#!/bin/bash
apt-get -y update
apt-get -y install build-essential ruby-dev git curl build-essential libxml2-dev libxslt-dev libssl-dev autoconf
if [ ! -e /opt/chef/bin/chef-solo ] ; then
curl -L https://www.opscode.com/chef/install.sh | bash
fi
if [ ! -e /opt/chef/embedded/bin/berks ] ; then
/opt/chef/embedded/bin/gem install berkshelf --no-ri --no-rdoc
@alfredodeza
alfredodeza / real.py
Last active April 26, 2022 10:58
Real time subprocess stdout/stderr
import logging
import threading
import os
import subprocess
logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.INFO)
class LogPipe(threading.Thread):
@jasonlai
jasonlai / erb-render.rb
Created December 31, 2014 07:12
Utility Ruby script to render ERB templates, loading a JSON file as source for instance variables (useful when you need to debug Puppet templates)
#!/usr/bin/env ruby
require 'erb'
require 'json'
require 'optparse'
require 'ostruct'
class ERBContext
def initialize(hash)
raise ArgumentError, 'hash must be a Hash object' unless hash.is_a?(::Hash)
@obfusk
obfusk / break.py
Last active December 7, 2024 13:12
python "breakpoint" (more or less equivalent to ruby's binding.pry); for a proper debugger, use https://docs.python.org/3/library/pdb.html
import code; code.interact(local=dict(globals(), **locals()))
@Timothee
Timothee / _command_runner.sh
Last active September 29, 2022 00:50
This function lets you easily create series of commands into a single call # It will print each successive command, run it and, as long as it returned # with code 0, continue to the next step. # If any step fails, it will stop and let you pick it back up after you fix the # issues.
#!/usr/bin/env bash
# This function lets you easily create series of commands into a single call
# It will print each successive command, run it and, as long as it returned
# with code 0, continue to the next step.
# If any step fails, it will stop and let you pick it back up after you fix the
# issues.
#
# Example of script using this function:
# !/usr/bin/env bash
@steinwaywhw
steinwaywhw / One Liner to Download the Latest Release from Github Repo.md
Last active May 10, 2025 14:55
One Liner to Download the Latest Release from Github Repo
  • Use curl to get the JSON response for the latest release
  • Use grep to find the line containing file URL
  • Use cut and tr to extract the URL
  • Use wget to download it
curl -s https://api.github.com/repos/jgm/pandoc/releases/latest \
| grep "browser_download_url.*deb" \
| cut -d : -f 2,3 \
| tr -d \" \
@JAMSUPREME
JAMSUPREME / README.md
Last active February 1, 2019 21:10
Gem and app version mgmt

Overview

The purpose of this gist is to explain some recommendations for managing versions for gems and applications. Specifically, the concepts will be the following:

  • How do we version? What are the conventions for branches and releases?
  • When do we tag? Can I tag if it is not a release?
  • When do we branch, and how long should that branch live?
  • What is upstream and what is downstream?

By the time we reach the conclusion hopefully you've discovered the answers to all of these questions!

@leonardofed
leonardofed / README.md
Last active May 8, 2025 09:49
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.