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:
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?
(function($){
$.fn.sticky = function () {
var toolbar = $(this);
var wrapper = $(this).wrap($('<div />', { id : toolbar.attr('id') + '-wrapper'})).parent();
$(this).width(wrapper.width());
wrapper.height($(this).outerHeight());
$(window).bind('scroll resize', function () {
toolbar.toggleClass('follow', !$.fn.sticky.isScrolledIntoView(wrapper));
});
/*javascript rank password function
copyright ryanday 2010
mit/gpl license
feel free to use and include as long as the code retains the above copyright. =)
PURPOSE:
i needed to present users with a password quality visual alert on keyup for the password on a registration form. this is the core function with no depends
USE://jquery example
//
// jQuery Slug Generation Plugin by Perry Trinier ([email protected])
// Licensed under the GPL: http://www.gnu.org/copyleft/gpl.html
jQuery.fn.slug = function(options) {
// Only do something if the element exists
if(this.length != 0) {
var settings = {
slug: 'slug', // Class used for slug destination input and span. The span is created on $(document).ready()
hide: true // Boolean - By default the slug input field is hidden, set to false to show the input field and hide the span.

Terms of Service

Last revised on [DATE]

The Gist

[COMPANY] operates the [SERVICE] service, which we hope you use. If you use it, please use it responsibly. If you don't, we'll have to terminate your account.

For paid accounts, you'll be charged on a monthly basis. You can cancel anytime, but there are no refunds.

Privacy Policy

Last revised on [DATE]

The Gist

[COMPANY] will collect certain non-personally identify information about you as you use our sites. We may use this data to better understand our users. We can also publish this data, but the data will be about a large group of users, not individuals.

We will also ask you to provide personal information, but you'll always be able to opt out. If you give us personal information, we won't do anything evil with it.

@ntulip
ntulip / x.php
Created June 10, 2010 15:06 — forked from gugod/x.php
# Kept from http://praetorianprefect.com/archives/2010/06/114000-ipad-owners-the-script-that-harvested-their-e-mail-addresses/
<?php
// iPad 3G Account Slurper
//
// Usage: ./ipadump.php ICCID-base count
// (The script generates the final checkdigit to produce ICCIDs from the entered base)
$useragent="Mozilla/5.0 (iPad)"; //Spoof as iPad
@ntulip
ntulip / test.cs
Created October 22, 2010 16:32 — forked from gorsuch/test.cs
using System;
using System.IO;
using System.Text;
using Amazon;
using Amazon.S3;
using Amazon.S3.Model;
namespace AWSUploadTest
{
require 'fileutils'
start_time = Time.now
SOURCE_DB = {
:name => 'db_name',
:user => 'db_user',
:password => 'db_pass',
:host => 'localhost'