Skip to content

Instantly share code, notes, and snippets.

View kylieCat's full-sized avatar
🏳️‍🌈
Codin them thangs

Kylie Rogers kylieCat

🏳️‍🌈
Codin them thangs
View GitHub Profile
@prwhite
prwhite / Makefile
Last active April 4, 2024 19:01
Add a help target to a Makefile that will allow all targets to be self documenting
# Add the following 'help' target to your Makefile
# And add help text after each target name starting with '\#\#'
help: ## Show this help.
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
# Everything below is an example
target00: ## This message will show up when typing 'make help'
@echo does nothing
@robmiller
robmiller / .gitconfig
Created July 17, 2013 07:52
Some useful Git aliases that I use every day
#
# Working with branches
#
# Get the current branch name (not so useful in itself, but used in
# other aliases)
branch-name = "!git rev-parse --abbrev-ref HEAD"
# Push the current branch to the remote "origin", and set it to track
# the upstream branch
publish = "!git push -u origin $(git branch-name)"
@pdc
pdc / testy.py
Created September 2, 2011 14:23
Mocking time to do time-sensitive unit tests in Python
import unittest
from mock import *
from datetime import datetime, timedelta
import time # so we can override time.time
mock_time = Mock()
mock_time.return_value = time.mktime(datetime(2011, 6, 21).timetuple())
class TestCrawlerChecksDates(unittest.TestCase):
@patch('time.time', mock_time)