Skip to content

Instantly share code, notes, and snippets.

View haraldmartin's full-sized avatar
🌝

Martin Ström haraldmartin

🌝
View GitHub Profile
Hello, world!
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" id="paypal_form">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHPwYJKoZIhvcNAQcEoIIHMDCCBywCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYBKAA+V0g6YVQgxaIVHhKMV5mcUBd1Nr6xgnCqFgnyiVLf5rouX7baqXBDEndhfSIzu1xqOmJEa8JNBlVl4jdjjPilHdI5QGNWfz2E5vzEmlsVaICe8PiJZXqcv+P+UZBMvt5ILS+MyRJgzEgJLO70A+//xjhae1hG7P17CjqyKsjELMAkGBSsOAwIaBQAwgbwGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQIce8xRfsVOuuAgZjoHY4fa+a4x9z56Jo7g0AV2cHc6mMYhgJO7fUON6u9g/nN4N1j3MiXZPeFYvivC0JIQl7egFfVLqoqY500NNYMrWtmF2O12XlDMyFbgPo1vgQDXOQtv7h9etZ4YUWVohnLbcLkMKN0MrRKeFfHDGUF9pbUUri6bV3LLjbrpGeayG0d22bnEf3ygZU+lz0DGam3f3O/inJD1qCCA4cwggODMIIC7KADAgECAgEAMA0GCSqGSIb3DQEBBQUAMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTD
var loadedCount = 0;
function onYouTubePlayerReady(playerId) {
if (++loadedCount == 4) {
     document.getElementById('player1').setVolume(0); // 50%
     document.getElementById('player2').setVolume(70); // 70%
     document.getElementById('player3').setVolume(100); // 100%
     document.getElementById('player4').setVolume(100); // 100%
var loadedCount = 0;
function onYouTubePlayerReady(playerId) {
if (++loadedCount == 4) {
     document.getElementById('player1').setVolume(0); // 50%
     document.getElementById('player2').setVolume(70); // 70%
     document.getElementById('player3').setVolume(100); // 100%
     document.getElementById('player4').setVolume(100); // 100%
# Generator for valid Swedish personnummer: http://en.wikipedia.org/wiki/Personal_identity_number_(Sweden)
# By Henrik Nyh <http://henrik.nyh.se> 2009-01-29 under the MIT license.
require 'date'
def make_pnr(date=nil, serial=nil)
date ||= Date.new(1900+rand(100), 1+rand(12), 1+rand(28))
serial = serial ? serial.to_s : format("%03d", rand(999)+1) # 001-999
date_part = date.strftime('%y%m%d')
/**
* Format any UTC timestamp on the page to the users local timezone.
*/
var DateFormat = {
autoParse: function(){
$$('span.timestamp').each(function(span) {
var utc = Date.parseUTC(span.innerHTML);
var rel = span.getAttribute('rel');
span.update(rel == 'words' ? utc.timeAgoInWords() : utc.strftime(rel))
});
#!/bin/sh
# domainavailable
# Fast, domain name checker to use from the shell
# Use globs for real fun:
# domainavailable blah{1..3}.{com,net,org,co.uk}
# Inspired by foca / giles:
# http://gilesbowkett.blogspot.com/2009/02/simple-bash-domain-availability.html
for d in $@;
daily
missingok
rotate 30
compress
delaycompress
sharedscripts
/Users/deploy/Sites/rails.example.com/shared/log/*.log {
postrotate
touch /Users/deploy/Sites/rails.example.com/current/tmp/restart.txt
function background(iterator, produceNextValue, callbacks) {
var value = {}, hasValue = produceNextValue(value);
callbacks = callbacks || Object.extend([], {
after: function(callback) {
this.push(callback);
return this;
}
});
if (hasValue) {
# Create a ~/.twitter/credentials.yml file.
# Example:
# name: twittername
# password: password
require 'rubygems'
require 'rest_client'
path = File.join(File.join(ENV['HOME'], ".twitter"), "credentials.yml")
user = YAML::load_file(path)