This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is ApacheBench, Version 2.3 <$Revision: 655654 $> | |
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ | |
Licensed to The Apache Software Foundation, http://www.apache.org/ | |
Benchmarking blog.darkhax.com (be patient) | |
Completed 100 requests | |
Completed 200 requests | |
Completed 300 requests | |
Completed 400 requests | |
Finished 400 requests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "thread" | |
module Gtk | |
PENDING_CALLS_MUTEX = Mutex.new | |
PENDING_CALLS = [] | |
def self.thread_protect(&proc) | |
if Thread.current == Thread.main | |
proc.call | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Then /^I should be (editing|viewing) "([^\"]*)"$/ do |method,login| | |
func = (method == 'editing' ? 'edit_' : '') + 'user_path' | |
URI.parse(current_url).path.should == eval("#{func}(User.find_by_login(login))") | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Tweet with surl | |
Plugin URI: http://s.darkhax.com | |
Description: Use surl with Twitter Tools | |
Version: 1.0 | |
Author: Daniel Huckstep | |
Author URI: http://www.darkhax.com | |
*/ | |
function get_content($url) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($){ | |
$.doAfter = function(time,f) { | |
$('body').animate({ opacity: 1 }, time, f); | |
}; | |
})(jQuery); | |
$(document).ready(function(){ | |
$.doAfter(2500,function() { | |
$('.fadeout').fadeOut('slow'); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
role_on :admin, :except => [:index,:show] | |
role_on :other_role, :on => [:index,:show] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
feed.entries.each do |e| | |
"Looking at the entry #{e.title.gsub("n",' ')}".printn | |
link = (Nokogiri(e.summary)/"img").to_html | |
next if link.empty? | |
link = link[/"(.*)"/].gsub(/["]/,'') | |
filename = link.split('/').last | |
disk_file = File.expand_path(File.join(ROOT,filename)) | |
unless File.exists?(disk_file) | |
"Downloading new image #{filename}...".print | |
Net.download_and_save(link,disk_file) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static string ToHumanFromPascal(this string s) | |
{ | |
if (2 > s.Length) | |
{ | |
return s; | |
} | |
var sb = new StringBuilder(); | |
var ca = s.ToCharArray(); | |
sb.Append(ca[0]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var theElement = "einstein-sb"; | |
var req = false; | |
getEinsteinInfo(); | |
function loadXMLDoc(url, method, async) { | |
try | |
{ | |
if (window.XMLHttpRequest) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'sinatra' | |
# this fails matching /2009/04/30/borland-c++-builder-5-how-i-hate-thee | |
get %r|^/\d{4}/\d{2}/\d{2}/[\w\d\-+]+$| do |match| | |
p match | |
end |