Skip to content

Instantly share code, notes, and snippets.

View jacurtis's full-sized avatar

J. Alexander Curtis jacurtis

View GitHub Profile
@mokagio
mokagio / sticky.css
Created February 26, 2012 20:53
Twitter Bootstrap + Sticky Footer + Fixed Nav Bar
html, body, .container, .content {
height: 100%;
}
.container, .content {
position: relative;
}
.proper-content {
padding-top: 40px; /* >= navbar height */
@bboer
bboer / CarQueryAPI.php
Created November 1, 2013 06:41
CarQueryAPI Sample CLass for PHP
<?php
/**
* Sample implementation fo the CarQueryAPI Json database
*/
class CarQueryAPI
{
/**
* @var string Url to the CarQueryAPI database
*/
protected $apiUrl = 'http://www.carqueryapi.com/api/0.3/?cmd=';
@ofaurax
ofaurax / modinverse.py
Created March 30, 2016 15:04
Modular Inverse for RSA in python
#!/usr/bin/env python3
p = 61
q = 53
n = p*q
phi = (p-1)*(q-1)
# Took from SO
def egcd(a, b):
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active April 24, 2024 09:43
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@genmon
genmon / streak.py
Last active February 6, 2024 01:20
Calculating a blogging streak -- pseudocode
# A Monday preceding the first post on this blog. Used for calculating week numbers
# (Weeks start on Mondays)
FIRST_MONDAY = date(2000, 2, 14)
# Calculate week_number and streak_weeks for every post, in order. For calculating today's
# streak, we only need to know about the most recent post, but there's a certain amount of
# looking at other posts to figure that out.
# Note: this code looks at *all* posts because I want to calculate all streaks. For just
# today's streak, a quicker algorithm would run in reverse chronological order and stop at
# the first break.