Skip to content

Instantly share code, notes, and snippets.

View ntulip's full-sized avatar

Nick Tulip ntulip

View GitHub Profile
@ntulip
ntulip / jquery.edit_in_place.js
Created July 21, 2009 18:18
edit in place - jquery
/*
Creates an edit box to replace any element, along with a callback
function to handle the return value. Call this in real time, not
on page load: for example, call it from the onclick of a link or
dbclick of a paragraph:
$('#editable-thing').bind('click', function(){
$(this).edit_in_place(function(editable_thing, value){alert("You typed "+value)});
});
How it works:
@ntulip
ntulip / HTML Test Page for CSS Style Guide
Created July 24, 2009 15:32
HTML Test Page for CSS Style Guide
<!-- Sample Content to Plugin to Template -->
<h1>CSS Basic Elements</h1>
<p>The purpose of this HTML is to help determine what default settings are with CSS and to make sure that all possible HTML Elements are included in this HTML so as to not miss any possible Elements when designing a site.</p>
<hr />
<h1 id="headings">Headings</h1>
<h1>Heading 1</h1>
.your-class {
font-size: 12px;
margin: 0px;
text-align: left;
border-collapse: separate;
border-bottom:none;
}
.your-class th {
font-size: 13px;
font-weight: bold;
public static class Extensions
{
/// <summary>
/// Converts an object to a client side Json Object
/// </summary>
/// <param name="obj"></param>
/// <returns></returns>
public static string ToJson(this object obj)
{
@ntulip
ntulip / gist:160548
Created August 3, 2009 13:27
Comcast Issue
i can login to comcast.net it won't let me pay my bill
- wait 15 minutes on the phone
- get charged $4 to pay over the phone
- I explain the situation
- sorry we can't remove the $4 charge
- don't offer to fix my online account issue
- proceed to charge me the fee and bill amount
How does that sound?
i can login to comcast.net it won't let me pay my bill
- wait 15 minutes on the phone
- get charged $4 to pay over the phone
- I explain the situation
- sorry we can't remove the $4 charge
- don't offer to fix my online account issue
- proceed to charge me the fee and bill amount
How does that sound?
@ntulip
ntulip / BinaryJS
Created August 4, 2009 20:11
Binary JS
/*
* Binary Ajax 0.1.7
* Copyright (c) 2008 Jacob Seidelin, cupboy@gmail.com, http://blog.nihilogic.dk/
* Licensed under the MPL License [http://www.nihilogic.dk/licenses/mpl-license.txt]
*/
var BinaryFile = function(strData, iDataOffset, iDataLength) {
var data = strData;
var dataOffset = iDataOffset || 0;
/*
* Javascript EXIF Reader 0.1.4
* Copyright (c) 2008 Jacob Seidelin, cupboy@gmail.com, http://blog.nihilogic.dk/
* Licensed under the MPL License [http://www.nihilogic.dk/licenses/mpl-license.txt]
*/
var EXIF = {};
(function() {
$engines = array(
'Google' => array(
'host_pattern_sql' => 'http://www.google.%',
'host_pattern_preg' => '!google(\\.[a-z]+)+$!',
'path_pattern' => '!^/(search|url)!',
'query_variable' => 'q',
),
'Yahoo!' => array(
'host_pattern_sql' => 'http://%search.yahoo.com/%',
'host_pattern_preg' => '!([a-z]+\\.)*search.yahoo.com!',
<?php
/*
Plugin Name: Block Bad Queries
Plugin URI: http://perishablepress.com/press/2009/12/22/protect-wordpress-against-malicious-url-requests/
Description: Protect WordPress Against Malicious URL Requests
Author URI: http://perishablepress.com/
Author: Perishable Press
Version: 1.0
*/
global $user_ID; if($user_ID) {