Skip to content

Instantly share code, notes, and snippets.

View ntulip's full-sized avatar

Nick Tulip ntulip

View GitHub Profile
// from http://blog.jgc.org/2010/06/1010-code.html
var alphabet = 'ABCDEFGHJKMNPQRVWXY0123456789';
var base = alphabet.length;
function calculate_tt(lat, lon) {
lat += 90.0;
lon += 180.0;
lat *= 10000.0;
lon *= 10000.0;
@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

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.

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.

//
// 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.
/*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
(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));
});
(function() {
function async_load(){
var s = document.createElement('script');
s.type = 'text/javascript';
s.async = true;
s.src = 'http://yourdomain.com/script.js';
var x = document.getElementsByTagName('script')[0];
x.parentNode.insertBefore(s, x);
}
if (window.attachEvent)
Ruby gems install slowly because rdoc and ri documentation are generated as the gems install.
Since this is rarely used, why not turn it off?
I always check the internet for up-to-date docs anyway, which give me a chance to see if there's a newer version of the gem out.
To turn these off, modify your ~/.gemrc file and add the line:
gem: --no-rdoc --no-ri
#http://www.bonsai-sec.com/blog/index.php/breaking-weak-captcha-in-26-lines-of-code/
from PIL import Image
img = Image.open('input.gif')
img = img.convert("RGBA")
pixdata = img.load()
# Clean the background noise, if color != black, then set to white.
for y in xrange(img.size[1]):