Skip to content

Instantly share code, notes, and snippets.

Avatar

Calvin Tennant calvintennant

View GitHub Profile
View instagram
https://api.instagram.com/v1/media/popular?client_id=0d9085d9f9c249faa9abc68f8b2e8ed5
View index.html
<!doctype HTML>
<html>
<head>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.1.1/css/bootstrap.css">
<link rel="stylesheet" href="styles.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="script.js"></script>
</head>
<body>
View gist:dac5caf8638ec3ed398f
https://api.instagram.com/v1/users/10206720/media/recent?client_id=585d00be2af34a26b0e1caa6995cf19f
@calvintennant
calvintennant / spriteMapper.js
Created Mar 9, 2012
Simple function that abstracts sprite mapping in Three.js
View spriteMapper.js
/**
* @param paramaters as object
*
* Prepare the object in
* the following format:
*
* material = spriteMapper({
* image: 'sprite.png',
* imageSize: 256, // size of image in px (must be square)
* spriteSize: 16, // size of sprite in px (must be square)
@calvintennant
calvintennant / gist:2226700
Created Mar 28, 2012 — forked from anonymous/gist:2221975
Licensing discussion with the creators of SASS
View gist:2226700
From: Calvin Tennant
Date: Tuesday, March 27, 2012
Subject: phpSass licensing
To: Nathan Weizenbaum <nex342@gmail.com>
Cc: Hampton <hcatlin@gmail.com>, Chris Eppstein <chris@eppsteins.net>
Awesome, I'm going to make a pastebin of this email just for records sake. Thanks for getting back to me so quickly.
:)
View gist:2255254
Notes on my current setup:
Adobe Production Premium CS5.5
Xcode 4
iTerm 2
# Homebrew
Homebrew
gettext
glib
View .rtorrent.rc
# Maximum and minimum number of peers to connect to per torrent.
#min_peers = 40
#max_peers = 100
# Same as above but for seeding completed torrents (-1 = same as downloading)
#min_peers_seed = 10
#max_peers_seed = 50
# Maximum number of simultanious uploads per torrent.
#max_uploads = 15
@calvintennant
calvintennant / getDistance.md
Created Apr 29, 2012
Function returns distance between two points in three dimensional space.
View getDistance.md
=> getDistance(Array(0,4,3), Array(0,0,0));
5
/**
 * Function returns distance between two points in three dimensional space
 * 
 * @param a as Array(x, y, z)
@calvintennant
calvintennant / fivestarminecraftwidget.patch
Created May 5, 2012
fivestar minecraft widget patch (drupal)
View fivestarminecraftwidget.patch
diff --git a/widgets/mcraft/mcraft-01.png b/widgets/mcraft/mcraft-01.png
new file mode 100644
index 0000000000000000000000000000000000000000..02f798407def0f3633ceb0b4c08eb88f4472a2c2
GIT binary patch
literal 3665
zcmYjTc{mha7rxWj_kBq;vdg|^AI83h5klFAq@k28%w$(T`@a29*-4hM*Vsiy$iDAU
zC=z9vPv0Nk^PT&=&$-LF_dWML|D4#Hrh2qgm#F{%v<CXx78f3Nfffof03c16FujWf
zrH{VtBLJwG{{jNCb2$K@GV??rZr=1j`=K9spnYHl2n5XMA==&Zz8e4mGkKOMq~#Wy
z+R?&KEu$Drsu9|Pl>%m=^&G>JBq+*D$zT}6TR6>X-odD&L&DWx5Ce^m$Gl)Q7o&-z
znj&B0Es76+851{fvK;)<YohIFW9YnLQhl@XAg^wi98W=$t}kmYkD)2k;$d70@9XYe
@calvintennant
calvintennant / fieldpermissionslocale.patch
Created May 5, 2012
patched locale so it plays nice with field_permissions (drupal)
View fieldpermissionslocale.patch
diff --git a/modules/locale/locale.module b/modules/locale/locale.module
index e0981b2..6877d8f 100644
--- a/modules/locale/locale.module
+++ b/modules/locale/locale.module
@@ -406,7 +406,7 @@ function locale_field_node_form_submit($form, &$form_state) {
// Handle a possible language change: new language values are inserted,
// previous ones are deleted.
- if ($field['translatable'] && $previous_language != $node->language) {
+ if ($field['translatable'] && $previous_language != $node->language && isset($form_state['values'][$field_name])) {