Skip to content

Instantly share code, notes, and snippets.

Avatar

Richard Cornish richardcornish

View GitHub Profile
@richardcornish
richardcornish / Typography cheat sheet
Last active Sep 13, 2017
These character sets are not exhaustive, but merely a quick reference for common characters.
View Typography cheat sheet
These character sets are not exhaustive, but merely a quick reference for common characters.
Quotation
‘ ‘ \2018 Left single quotation mark
’ ’ \2019 Right single quotation mark/Apostrophe
“ “ \201C Left double quotation mark
” ” \201D Right double quotation mark
' ' \0027 Typewriter single quotation mark
" " \0022 Typewriter double quotation mark
′ ′ \2032 Prime (Feet / Minutes)
@richardcornish
richardcornish / Quest mode in Google Maps
Created Apr 20, 2012
How to add the Quest mode in Google Maps from April Fools Day 2012
View Quest mode in Google Maps
// Set map options
var mapOptions = {
center: new google.maps.LatLng(41.917142, -87.673837), // Or whatever
zoom: 15,
mapTypeId: "quest",
mapTypeControlOptions: {
mapTypeIds: [google.maps.MapTypeId.ROADMAP, google.maps.MapTypeId.SATELLITE, "quest"]
},
scrollwheel: false
}
@richardcornish
richardcornish / Git notes
Last active Jul 13, 2021
Enough Git for your résumé in 100ish lines
View Git notes
Start
=====
1. Install Git
http://git-scm.com/download/mac
(But consider using Homebrew)
2. Make a GitHub account
https://github.com/
3. Open Terminal
View HTML5 template
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>
<style>
body { margin: 0; padding: 0; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; }
@richardcornish
richardcornish / How to create and inherit objects in JavaScript
Last active Dec 17, 2015
Basic notes on how to create and inherit objects the crazy-ass JavaScript way.
View How to create and inherit objects in JavaScript
/* -------------------------------------------------------
Old-school way to create child objects from parent objects
--------------------------------------------------------*/
var Person = function (name, age, sex) {
this.name = name;
this.age = age;
this.sex = sex;
}
Person.prototype.sayGreeting = function () {
@richardcornish
richardcornish / MySQLgenerator
Last active Apr 19, 2016
Bash script that quickly generates a MySQL database, user, and password
View MySQLgenerator
#!/bin/bash
# Usage:
# $ brew install mysql
# $ launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
# $ bash -c "$(curl -fsSL https://gist.githubusercontent.com/richardcornish/e9093757a6977b1b6b5b/raw)"
echo "Welcome to the MySQL generator!"
read -p "Database name: " dbname
read -p "Database user: " dbuser
@richardcornish
richardcornish / Modern setup
Last active Aug 29, 2015
Notes on installing and upgrading with modern web development tools
View Modern setup
# Paths
touch ~/.bash_profile
echo -e "#Paths\nexport PATH=/usr/local/bin:\$PATH\n"|cat - ~/.bash_profile > /tmp/out && mv /tmp/out ~/.bash_profile
source ~/.bash_profile
# Permissions
sudo chown -R $USER ~/.npm
sudo chown -R $USER /usr/local
# Command line tools from [Xcode](https://itunes.apple.com/us/app/xcode/id497799835?mt=12)
@richardcornish
richardcornish / Mapbox Studio examples
Last active Aug 29, 2015
I fished these URLs out of the JSON requests in https://www.mapbox.com/design/
View Mapbox Studio examples
Space Station
https://a.tiles.mapbox.com/v4/examples.3hqcl3di/page.html?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6IlhHVkZmaW8ifQ.hAMX5hSW-QnTeRCMAy9A8Q
Roadtrippers
https://a.tiles.mapbox.com/v4/examples.ra3sdcxr/page.html?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6IlhHVkZmaW8ifQ.hAMX5hSW-QnTeRCMAy9A8Q
Assemblage (random)
https://a.tiles.mapbox.com/v4/saman.h6ek9086/page.html?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6IlhHVkZmaW8ifQ.hAMX5hSW-QnTeRCMAy9A8Q
Wheatpaste
View Sublime Text 2 command line shortcut
sudo ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl
@richardcornish
richardcornish / GitHub pages branch
Last active Aug 29, 2015
Creates a gh-pages branch based on a gh-pages directory, and serves its contents as a <username>.github.io website
View GitHub pages branch
# First time
mkdir gh-pages
touch gh-pages/index.html
git add gh-pages
git commit -m "First commit of GitHub Pages branch"
git push origin master
# Subsequent times
# Edit, save, commit, push files inside gh-pages directory
git subtree push --prefix gh-pages origin gh-pages