Skip to content

Instantly share code, notes, and snippets.

View freekrai's full-sized avatar

Roger Stringer freekrai

View GitHub Profile
// Plugin
$.fn.iWouldLikeToAbsolutelyPositionThingsInsideOfFrickingTableCellsPlease = function() {
var $el;
return this.each(function() {
$el = $(this);
var newDiv = $("<div />", {
"class": "innerWrapper",
"css" : {
"height" : $el.height(),
"width" : "100%",
@freekrai
freekrai / gist:1112482
Created July 28, 2011 20:32 — forked from chriscoyier/gist:945619
commentgraph.php
<?php
/*
Template Name: Comment Graph
*/
?>
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8>
@freekrai
freekrai / backbone.behaviour.js
Created March 9, 2012 22:30 — forked from Qard/backbone.behaviour.js
Behaviour abstraction system for backbone.js
!function (Backbone) {
// Store blank stuff here
var blankEl = $()
, blankModel = new Backbone.Model.extend()
, blankCollection = new Backbone.Collection.extend({
model: blankModel
})
, blankView = new Backbone.View.extend({
el: blankEl
})
@freekrai
freekrai / DropboxSync.py
Created December 1, 2012 16:34 — forked from wrenoud/DropboxSync.py
DropboxSync
import os
import sys
import pickle
import console
import dropboxlogin # this code can be found here https://gist.github.com/4034526
STATE_FILE = '.dropbox_state'
class dropbox_state:
@freekrai
freekrai / Image Effects.py
Created December 6, 2012 16:23 — forked from silarsis/Image Effects.py
Pythonista Scripts
# Image Effects
# Demonstrates some effects using different modules
# from the Python Imaging Library (PIL).
#
# Tip: You can touch and hold an image in the output
# to copy it to the clipboard or save it to your
# camera roll.
import Image, ImageOps, ImageFilter
from Image import BILINEAR
<?php
require_once('mailer/class.phpmailer.php');
$myName = "YourName";
$email_pattern = "/^([a-z0-9\.\-\+\_\']+)@[a-z0-9\-\+\_]+\.[a-z0-9\-\+\_]*(\.?)[a-z0-9]+$/";
$email_address = trim($_POST['Body']);
$email = new PHPMailer();
$email->From = 'FromEmail';
$email->AddReplyTo('FromEmail', $myName);
$email->Mailer = 'mail';
/*
* Default WP Alignment Classes
*****************************************************************************/
.aligncenter,.alignleft,.alignright {
display: block;
padding: 0;
}
.aligncenter {
@freekrai
freekrai / grab thumb url.php
Last active November 15, 2021 10:30 — forked from jlengstorf/grab thumb url.php
If no featured image... Grab the first image in the post content.. Or generate a thumbnail based on youtube or vimeo video if that is included instead of an image... then save the image as featured image...
<?php
/**
* Retrieves the thumbnail URL to use for a post
* @param string $text The body of the post (get_content)
* @param string $size The image size to retrieve
* @return string The image URL to use
*/
function get_thumb_url($text, $size){
global $post;
$imageurl = FALSE;

Intro

These gists will help through the installation of PHP54, MySQL, and Postgres

Pre-Requisists

This assumes that you have already installed Homebrew (http://mxcl.github.io/homebrew/)

Installation

<?php
$email = "me@example.com";
// To find your weather feed....
// * Go here: http://forecast.weather.gov/MapClick.php?lat=37.7749295&lon=-122.41941550000001#.UdpHAj7714E
// * Search for your location (upper left side of the page as of 7/7/2013)
// * Click the orange "XML" button/link (on the right hand side, beneath the first map as of the same date)
$feed = 'http://forecast.weather.gov/MapClick.php?lat=39.01000&lon=-96.28&unit=0&lg=english&FcstType=dwml';