Skip to content

Instantly share code, notes, and snippets.

@shanselman
shanselman / gist:5422230
Last active April 10, 2025 15:49
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.|
@timcharper
timcharper / string.rb
Created November 6, 2012 20:50
to_underscore implementation
class String
# ruby mutation methods have the expectation to return self if a mutation occurred, nil otherwise. (see http://www.ruby-doc.org/core-1.9.3/String.html#method-i-gsub-21)
def to_underscore!
g = gsub!(/(.)([A-Z])/,'\1_\2'); d = downcase!
g || d
end
def to_underscore
dup.tap { |s| s.to_underscore! }
end
@avdi
avdi / apology101.markdown
Created March 22, 2012 17:36
How to apologize

Chances are your head's spinning right now. That accusation of bias caught you off guard, you got kind of defensive, and now all hell has broken loose. You're feeling attacked on all sides. You're a good person at heart, and having all these people treat you like the antichrist is pretty upsetting.

You need to say something, but you're probably not in the best headspace to write copy right now. So to help you along, here's my 100% guaranteed-or-you-money-back scandal defusement apology template:

@holman
holman / gemspec-usage.md
Created February 12, 2012 07:02
test/spec/mini

Just install this in your apps like so:

gem 'test-spec-mini', :git => 'git://gist.github.com/1806986.git', :require => 'mini'

@smowden
smowden / cofounder
Created February 10, 2012 00:26
Cofounder wanted
Under funded but over motivated new startup is looking for a second technical cofounder to make us a trio.
What is this about?
Our startup is working on aggregating, categorizing and contextualizing data from across the internet
in a business context and evaluating people based on a algorithm that is fed by the gathered data.
(so if you are looking for a position at some cookie cutter webapp you can stop reading right here)
We (one technical and one nontechnical founder) are looking for another
nerd/programmer/web developer/software engineer/hacker/pythonista/ninja/rockstar/code enthusiast/generalist/brogrammer
or whatever you prefer to call yourself to join our team.
# -- coding: utf-8
require "pp"
require "rubygems"
require 'sinatra'
require 'sinatra/base'
module Sinatra
module Helpers
class Stream
require 'ffi'
module ChdirExec
extend FFI::Library
ffi_lib 'c'
attach_function :execlp, [:string, :varargs], :int
attach_function :chdir, [:string], :int
def self.chdir_exec(dir, cmd, *argv)