Skip to content

Instantly share code, notes, and snippets.

View rpersaud's full-sized avatar
🎯
Focusing

Robert Persaud rpersaud

🎯
Focusing
View GitHub Profile
@rpersaud
rpersaud / gist:1847060
Created February 16, 2012 19:04
Drupal Render Form node.tpl
<div class="content clearfix"<?php print $content_attributes; ?>>
<?php
// We hide the comments and links now so that we can render them later.
hide($content['comments']);
hide($content['links']);
drupal_render($content);
// display only for authenticated users
global $user;
if ($user->uid) {
@rpersaud
rpersaud / main.lua
Created February 3, 2012 18:13
Clamp Rotating Object in Love2d
-- callback
function love.load()
-- our player
hero = love.graphics.newImage("gengar.png")
-- Set world for physics bodies to exist in 'https://love2d.org/wiki/Tutorial:Physics
world = love.physics.newWorld(0, 0, 800, 600)
world:setGravity(0, 400) --
world:setMeter(30) -- default 30 pixels per meter
@rpersaud
rpersaud / gist:1679130
Created January 25, 2012 22:10
Custom Formats for Drupal Date/Time
<\d\iv \c\l\a\s\s="\m">M</\d\iv><\d\iv \c\l\a\s\s="\d">d</\d\iv><\d\iv \c\l\a\s\s="\y">Y</\d\iv>
@rpersaud
rpersaud / jqueryui-auto.html
Created January 4, 2012 22:22
Figuring out the most efficient javascript method for autocomplete
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/base/jquery-ui.css" type="text/css" media="all" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" type="text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js" type="text/javascript"></script>
<meta charset="utf-8">
<script>
$(function() {
var availableTags = [
"ActionScript",
"AppleScript",
@rpersaud
rpersaud / install.txt
Created January 4, 2012 16:48
Figuring out memcache for mamp/php
@see http://www.re-cycledair.com/installing-memcache-on-mamp
Step 1: Install XCode
Step 2: Make the MAMP PHP binary files executable
sudo chmod +xrw /Applications/MAMP/bin/php5.3/bin/p*
Step 3: Get the Memcache extension source
cd ~
wget http://pecl.php.net/get/memcache-2.2.5.tgz