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)

To Make Cheese Sauce

I usually make 2 lbs of medium - large shells.

For every lb. of pasta:

  • 1 1/2 cups milk
  • 1 1/2 tbsp. flour
  • 1 1/2 Tbsp. unsalted butter - very important you use unsalted butter throughout
  • 1 1/2 cups shredded cheese
@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.
@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"
function cover { coverage run --source='.' --omit='*.pyc. *.html' ./manage.py test $1;coverage html; }
export cover
alias coverall="coverage run --source='.' --omit='*.pyc. *.html' ./manage.py test account api group item;coverage html"
alias testall="./manage.py test account api channel group item moderation notifications payments"
# Git completion/colorful prompt
source ~/.git-completion.bash
source ~/.git-prompt.sh
PS1='[\u@\h \W$(__git_ps1 " (%s)")]\$ '
GIT_PS1_SHOWDIRTYSTATE=1
l = ['a','b', 'c']
for index, value in enumerate(l):
print("The value at index {} is {}".format(index, value)
# Output
# The value at index 0 is a
# The value at index 1 is b
# The value at index 2 is c
{"setting":{"duration":{"color":{"a":255,"r":255,"g":255,"b":255}},"border":{"color":{"a":255,"r":255,"g":255,"b":255}},"auras":[{"overlay":{"source":"1"},"dynamic":{"source":"1"},"behavior":"All","duration":{"source":"1"},"border":{"enable":true,"sprite":"sprAS_Chnl_Flash"},"stacks":{"source":"1"},"name":"Spell Surge","bar":{"source":"1"},"icon":{"sprite":"Icon_SkillMisc_UI_m_slvo","source":"1","posY":-227,"posX":-205},"triggers":[{"triggerType":"Buff","border":{"color":{"a":255,"r":255,"g":255,"b":255}},"spellName":"Spell Surge","unit":"Player","name":"Buff"}]},{"overlay":{"source":"1"},"charges":{"source":"1"},"dynamic":{"source":"1"},"behavior":"All","duration":{"source":"1"},"bar":{"source":"1"},"visibility":{"combat":false},"name":"Charged Shot","text":{"source":"1"},"icon":{"sprite":"Icon_SkillSpellslinger_charged_shot","source":"1","posX":-142,"height":45,"posY":-73,"width":45},"triggers":[{"triggerType":"Ability","border":{"color":{"a":255,"r":255,"g":255,"b":255}},"spellName":"Charged Shot","name":"
org_name=$1
curl -s https://api.github.com/orgs/$org_name/repos\?per_page\=100 | perl -ne 'print "$1\n" if (/"ssh_url": "([^"]+)/)' | xargs -n 1 git clone
@kylieCat
kylieCat / main.go
Created January 9, 2018 03:37 — forked from enricofoltran/main.go
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@kylieCat
kylieCat / main.go
Created January 9, 2018 03:45 — forked from creack/main.go
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"fmt"
"log"
"net/http"
"os"
"os/signal"
"strconv"