Skip to content

Instantly share code, notes, and snippets.

View joeydi's full-sized avatar

Joe di Stefano joeydi

View GitHub Profile
@DustyReagan
DustyReagan / Twitter User Object MySQL Schema.sql
Created April 1, 2010 23:22
Twitter User Object MySQL Schema
CREATE TABLE `user` (
`twitter_id` int(10) unsigned NOT NULL,
`created_at` timestamp NOT NULL default '0000-00-00 00:00:00',
`name` varchar(80) NOT NULL,
`screen_name` varchar(30) NOT NULL,
`location` varchar(120) default NULL,
`description` varchar(640) default NULL,
`profile_image_url` varchar(400) NOT NULL,
`url` varchar(100) default NULL,
@mourner
mourner / TileLayer.Common.js
Created February 11, 2012 23:11
Leaflet shortcuts for common tile providers
// Lefalet shortcuts for common tile providers - is it worth adding such 1.5kb to Leaflet core?
L.TileLayer.Common = L.TileLayer.extend({
initialize: function (options) {
L.TileLayer.prototype.initialize.call(this, this.url, options);
}
});
(function () {
@hrldcpr
hrldcpr / tree.md
Last active May 1, 2024 00:11
one-line tree in python

One-line Tree in Python

Using Python's built-in defaultdict we can easily define a tree data structure:

def tree(): return defaultdict(tree)

That's it!

@cballou
cballou / youtube-vimeo-embed-urls.php
Created March 27, 2012 15:52
PHP Function to Convert Youtube and Vimeo URLs to Lightbox-Ready Equivalents
<?php
/**
* Given a string containing any combination of YouTube and Vimeo video URLs in
* a variety of formats (iframe, shortened, etc), each separated by a line break,
* parse the video string and determine it's valid embeddable URL for usage in
* popular JavaScript lightbox plugins.
*
* In addition, this handler grabs both the maximize size and thumbnail versions
* of video images for your general consumption. In the case of Vimeo, you must
* have the ability to make remote calls using file_get_contents(), which may be
@esfand
esfand / Deploy
Created April 5, 2012 15:11
WebFaction Deploy Apps using Git
I've tried now for several hours understanding how to use Git with webfaction.
And even with the documentation I cannot get it to work.
I have a Django app at: webapps/django_app/project_name/
I have a Git repo at: webapps/git_app/repos/my_repo.git
I assume the following workflow:
Make som local changes
import sys
import csv
import httplib, urllib, base64
def main():
# set the name of your repository, username and password
username = "test"
password = "test"
repo = "test"
@Ssiskind
Ssiskind / HubSpot Landing Page Dummy Form Code
Created August 15, 2012 23:13
Use this sample code to generate a dummy form in your HubSpot landing page template
<div class="form-wrapper">
<div class="form-wrapper-inner">
<div id="hubspot_form_widget_wrapper">
{% form "main_form" editing={group="page_actions", order=30} %}
</div>
<div id="hubspot_dummy_form" style="display: none">
<form class="hs-form stacked">
<h3 class="form-title">Fill Out Our Form</h3>
<div class="field">
<label>First Name</label>
@kasparsd
kasparsd / wordpress-plugin-svn-to-git.md
Last active April 17, 2024 12:35
Using Git with Subversion Mirroring for WordPress Plugin Development
@awshout
awshout / foundation4-topbar-menu.php
Last active August 19, 2023 02:44
WordPress Menu & Walker for ZURB's Foundation 4 Top Bar
<?php
add_theme_support('menus');
/**
* Register Menus
* http://codex.wordpress.org/Function_Reference/register_nav_menus#Examples
*/
register_nav_menus(array(
'top-bar-l' => 'Left Top Bar', // registers the menu in the WordPress admin menu editor
'top-bar-r' => 'Right Top Bar'
@wpscholar
wpscholar / functions.php
Last active March 1, 2021 13:26
Enqueueing IE conditional stylesheets in WordPress the right way
<?php
add_action( 'wp_enqueue_scripts', 'enqueue_my_styles' );
/**
* Example callback function that demonstrates how to properly enqueue conditional stylesheets in WordPress for IE.
* IE10 and up does not support conditional comments in standards mode.
*
* @uses wp_style_add_data() WordPress function to add the conditional data.
* @link https://developer.wordpress.org/reference/functions/wp_style_add_data/