Skip to content

Instantly share code, notes, and snippets.

View thomascrenshaw's full-sized avatar

Thomas Crenshaw thomascrenshaw

  • Circa Digital (Publishing)
  • Walnut Creek, CA
View GitHub Profile
@thomascrenshaw
thomascrenshaw / hr-image
Created April 8, 2015 18:04
using image for presentation and <hr> for semantics
<!-- css looks like this -->
<style>
.divider {
border: 0;
height: 13px;
background: url(divider.png) center;
background-repeat: none;
}
.divider hr {
display: none;
/* -------- Start Rotating Cards ---------*/
/* REF: http://css3-magic.brunoscopelliti.com/css3-transition-demos.html
/* HTML */
<div class="ext" ontouchstart="this.classList.toggle('hover');">
<div class="int">
<div class="front">
<!-- your custom content -->
</div>
<div class="back">
<!-- your custom content -->
@thomascrenshaw
thomascrenshaw / pjd-bikes-views
Created April 1, 2014 20:59
View template for bikes on PJD
<div id="pjd-gallery-content">
<div id="content-container-bikegallery" class="shadow">
<div class="content">
<h1>[wpv-post-title]</h1>
<div id="myGallery">
[types field="slide-shortcode" output="raw"][/types]
</div> <!-- end myGallery -->
</div> <!-- end content -->
<div id="container-text">
<div class="gallery-sidebar-but">
@thomascrenshaw
thomascrenshaw / My Memory - Git Commands
Created January 31, 2014 18:52
Useful Git commands with references
##---------------------------
## Keep local branch up-to-date with remote
# Add the upstream remote if have not already done so
git remote add upstream REMOTE_PROJECT_URL_git
# Fetch changes in REMOTE_PROJECT_URL_git
git fetch upstream
# Bring master of your locl fork-clone up-to-date
git checkout master && git merge upstream/master
# Rebase the LOCAL_BRANCH works if no uncommited changes
git rebase upstream/master
@thomascrenshaw
thomascrenshaw / gist:7080207
Last active July 11, 2016 20:07
This is how I installed node.js on DigitalOcean. Major things
The objective of this post is to get you from absolutely nothing, to a fully functional nodejs environment.
Software used: Ubuntu 12.10 x64, Nodejs v0.6.12, Nginx, MongoDB, Redis, and NPM modules.
1. Create new droplet using Ubuntu 12.10 x64
2. As root install
a. sudo apt-get install openssh-server
b. sudo apt-get install libssl-dev
c. sudo apt-get install git
d. sudo apt-get install g++
e. sudo apt-get install make
@thomascrenshaw
thomascrenshaw / notes-base36
Last active November 18, 2020 19:07
base 36 () functions in various languages
# php
<?php print base_convert("12abcxyz",36,10); ?>
----
#python
def base36encode(number, alphabet='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'):
"""Converts an integer to a base36 string."""
if not isinstance(number, (int, long)):
raise TypeError('number must be an integer')
base36 = ''