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
@kylieCat
kylieCat / gist:e33b4ee483b222db0dd5
Last active November 28, 2015 19:59
SO Comments
## Welcome
Welcome to Stackoverlfow! You will greatly increase your chances of getting an answer for your question if you include your input, what you have tried, your expected output vs. your actual output and the full stack trace of any errors you receive. You can also read [this guide](http://stackoverflow.com/help/mcve)
@kylieCat
kylieCat / prepare-commit-msg
Last active October 15, 2015 15:57
Git hook to append branch name to commit message
# Automatically adds the JIRA ticket number to the end of every commit message.
# This will work provided your branch is named in the form [a-zA-Z]{3}-[0-9]{3,}
# Place this file in PROJECT/.git/hooks and make it executable chmod +x path/to/file
# Example:
# [BND-1234] <--- This is a branch name
# $ git commit -am "This is my message"
# [BND-1234 1edab53] This is my message [BND-1234]
#
# [BND-1234-This-Branch-Has-A-Description] <--- This is a branch name
# $ git commit -am "This is my message"
@kylieCat
kylieCat / fermat.py
Last active September 12, 2015 23:12 — forked from bnlucas/fermat.py
Fermat primality testing with Python.
def fermat(n):
if n == 2:
return True
if not n & 1:
return False
return pow(2, n-1, n) == 1
# benchmark of 10000 iterations of fermat(100**10-1); Which is not prime.
# 10000 calls, 21141 per second.