Skip to content

Instantly share code, notes, and snippets.

View travis-g's full-sized avatar
🎲
rolling dice

Travis Grammer travis-g

🎲
rolling dice
View GitHub Profile
@travis-g
travis-g / index.html
Last active August 29, 2015 13:57
HTML5 Boilerplates
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
@travis-g
travis-g / vol_change.sh
Last active August 29, 2015 14:07
Volume change hotkey script
#!/bin/bash
# by @travis-g, WTFPL 2 (https://wtfpl2.com/)
function showHelp() {
echo "Usage: vol_change.sh [up|down INT]
"; exit $1; }
if [[ ! $@ ]] ; then showHelp 1; fi # show help if no opts
i=5 && [[ $2 =~ ^[0-9]+$ ]] && i=$2 # set base increment
case $1 in
"up") i=$i"+";;
"down") i=$i"-";;
@travis-g
travis-g / Fullscreen-tumblr.xm
Last active August 29, 2015 14:20
Fullscreen Tumblr Tweak
#import <substrate.h>
// hide the status bar (fullscreen)
%hook TMPostsViewController
- (BOOL)prefersStatusBarHidden
{
return YES;
}
@travis-g
travis-g / whatthecommit.sh
Last active February 20, 2023 01:02
Commit message generator based on whatthecommit.com
#!/usr/bin/env sh
usage() {
cat <<EOF
whatthecommit.sh - an offline commit message generator based on whatthecommit.com
usage: $(basename $0) [-h]
-h print this help
example:
@travis-g
travis-g / css-selectors.md
Created June 12, 2015 19:46
CSS Selectors

CSS Selectors

The "CSS" column indicates in which CSS version the property is defined (CSS1, CSS2, or CSS3).

Selector Example Example description CSS
.class .intro Selects all elements with class="intro" 1
#id #firstname Selects the element with id="firstname" 1
  • | * | Selects all elements | 2
@travis-g
travis-g / Preferences.sublime-settings
Created June 18, 2015 14:29
Sublime Text Settings
{
// draw spaces and tabs (selection, all, none)
"draw_white_space": "all",
// auto-tidy lines if they have trailing whitespace
"trim_trailing_white_space_on_save": true,
// always have a newline character at the end of a file
"ensure_newline_at_eof_on_save": true,
@travis-g
travis-g / statuses.md
Last active August 29, 2015 14:24
HTTP response status codes
Code Definition Meaning
1xx Informational Received request, continuing process.
2xx Success The action requested was received, understood, accepted and processed.
200 OK Action completed successfully.
3xx Redirection The client must take additional action for the request to be completed
302 Found The requested URI was found. Sometimes results in a redirect, similarly to 303 See Other
303 See Other The response can be found under another URI. Assume the server received the data.
304 Not Modified A cached version of the re
@travis-g
travis-g / responsive-text.scss
Created August 13, 2015 20:15
SCSS class for responsive and fluidly-resizing text
// smallest font size:
$font-size: 100%;
// minimum width before resizing rules apply:
$min-width: 340px;
// the range in width to create the resizing steps:
$range: 600px;
// number of resizing steps to make (more steps yields more fluid resizing):
$steps: 10;
// calculate the width of each step:
$step-size: $range / $steps;
@travis-g
travis-g / font-face.styl
Created August 13, 2015 20:25
Stylus function for defining webfonts
file-url(file, path = '../fonts/)
return path + file
font-face(family, file, weight = 'normal')
@font-face
font-family family
src url(file-url(file + '.eot'))
src url(file-url(file + '.eot?#iefix')) format('embedded-opentype'),
url(file-url(file + '.woff2')) format('woff2'),
url(file-url(file + '.woff')) format('woff'),
@travis-g
travis-g / random_mac.sh
Created October 9, 2015 20:24
MAC randomizer script
#!/bin/sh
usage() {
cat<<EOF
usage: $(basename $0) [-h] dev
Useful for getting around timed public WiFi sessions. Your wireless device may
need to be restarted after running for the changes to apply.
EOF
}