Skip to content

Instantly share code, notes, and snippets.

View wizardishungry's full-sized avatar
🐫
Copyright 1987-2013, Larry Wall

Jon Williams wizardishungry

🐫
Copyright 1987-2013, Larry Wall
View GitHub Profile
@shanselman
shanselman / gist:5422230
Last active March 28, 2024 10:33
Evil Blog Comment Spammer just exposed his template through some error and the whole thing showed up in my comments.
{
{I have|I've} been {surfing|browsing} online more than {three|3|2|4} hours today, yet I never found any interesting article like yours. {It's|It
is} pretty worth enough for me. {In my opinion|Personally|In my view}, if all {webmasters|site owners|website owners|web owners} and bloggers made good content as
you did, the {internet|net|web} will be {much more|a lot more}
useful than ever before.|
I {couldn't|could not} {resist|refrain from} commenting. {Very well|Perfectly|Well|Exceptionally well} written!|
{I will|I'll} {right away|immediately} {take hold of|grab|clutch|grasp|seize|snatch}
your {rss|rss feed} as I {can not|can't} {in finding|find|to find} your {email|e-mail} subscription {link|hyperlink} or {newsletter|e-newsletter} service. Do {you have|you've} any?
{Please|Kindly} {allow|permit|let} me {realize|recognize|understand|recognise|know} {so that|in order that} I {may just|may|could} subscribe.
Thanks.|
@mwunsch
mwunsch / emoji_image_replace.js
Last active August 13, 2023 21:44
Detect emoji unicode on a page, replace it with images (supplied by GitHub, for now). Goes great in your ~/.js
/**
*
* Here's a thing that will look through all the text nodes of a document, and
* upon encountering an emoji codepoint, will replace it with an image.
* For now, those images are pulled from GitHub, which isn't very nice, so I
* need to find a more suitable host.
*
* Much of this code was gleaned from staring at the minified GitHub JS.
*
* Copyright (c) 2013 Mark Wunsch. Licensed under the MIT License.
@purem
purem / Wolfram alpha named parametric curves
Created January 31, 2013 23:05
Wolfram alpha named parametric curves
Enter into wolfram alpha to draw
witch of Agnesi
ampersand curve
Archimedean spiral
Archimedes' spiral
astroid
astroid pedal curve
atriphtaloid
bean curve
@mrmt
mrmt / follow-back.pl
Created December 1, 2012 02:31
following back my twitter followers
#!/usr/bin/perl
# following back my twitter followers
# get consumer keys and access token from http://dev.twitter.com/apps/new
use utf8;
use strict;
use warnings;
use Net::Twitter;
use YAML::Tiny;
sub usage{
@ndfred
ndfred / install_airport_utility_5.6.1.sh
Created November 8, 2012 22:22
Download and install the Airport Utility 5.6.1 app on Mac OS X Lion and up
#!/bin/sh -e
# Download and install the Airport Utility 5.6.1 app on Mac OS X Lion and up
if [ ! -d "/Applications/Utilities/AirPort Utility 5.6.1.app" ]
then
[ -d /Volumes/AirPortUtility ] && hdiutil detach /Volumes/AirPortUtility
rm -rf /tmp/AirPortUtility5.6.1.dmg /tmp/AirPortUtility5.6.1
echo "Downloading Airport Utility 5.6.1"
@luismayta
luismayta / CsrfProtect.php
Created October 30, 2012 00:39
CsrfProtect by zend framework
<?php
/**
* A controller plugin for protecting forms from CSRF
*
* Works by looking at the response and adding a hidden element to every
* form, which contains an automatically generated key that is checked
* on the next request against a key stored in the session
*
* @author Jani Hartikainen <firstname at codeutopia net>
*/
@mattb
mattb / gist:3888345
Created October 14, 2012 11:53
Some pointers for Natural Language Processing / Machine Learning

Here are the areas I've been researching, some things I've read and some open source packages...

Nearly all text processing starts by transforming text into vectors: http://en.wikipedia.org/wiki/Vector_space_model

Often it uses transforms such as TFIDF to normalise the data and control for outliers (words that are too frequent or too rare confuse the algorithms): http://en.wikipedia.org/wiki/Tf%E2%80%93idf

Collocations is a technique to detect when two or more words occur more commonly together than separately (e.g. "wishy-washy" in English) - I use this to group words into n-gram tokens because many NLP techniques consider each word as if it's independent of all the others in a document, ignoring order: http://matpalm.com/blog/2011/10/22/collocations_1/

@bsdf
bsdf / gist:3686369
Created September 9, 2012 18:44
tblq
#!/usr/bin/env perl
use strict;
use warnings;
use WWW::Tumblr;
die 'u need to specify some filesz' if not @ARGV;
my $t = WWW::Tumblr->new(
#!/usr/bin/env perl
use utf8;
binmode STDOUT, ":utf8";
while (<>) {
tr/A-Za-z/𝕬𝕭𝕮𝕯𝕰𝕱𝕲𝕳𝕴𝕵𝕶𝕷𝕸𝕹𝕺𝕻𝕼𝕽𝕾𝕿𝖀𝖁𝖂𝖃𝖄𝖅𝖆𝖇𝖈𝖉𝖊𝖋𝖌𝖍𝖎𝖏𝖐𝖑𝖒𝖓𝖔𝖕𝖖𝖗𝖘𝖙𝖚𝖛𝖜𝖝𝖞𝖟/;
print;
}
@rubysolo
rubysolo / gist:2430067
Created April 20, 2012 16:16 — forked from marcel/gist:2100703
giftube – Generates an animated gif from a YouTube url.
#!/usr/bin/env ruby
# giftube – Generates an animated gif from a YouTube url.
#
# Usage:
#
# giftube [youtube url] [minute:second] [duration]
#
# ex.
#