Skip to content

Instantly share code, notes, and snippets.

@schmich
schmich / psiupuxa.rb
Last active February 8, 2022 14:55
Download desktop-resolution wallpapers from http://psiupuxa.com/
# Download desktop-resolution wallpapers from http://psiupuxa.com/
# into the current directory.
require 'nokogiri'
require 'open-uri'
require 'openssl'
require 'uri'
# Disable SSL verification. Ruby SSL cert bundle isn't installed on Windows by default.
OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE
@endymion
endymion / contact.rb
Last active February 18, 2024 22:49
Example of integrating a Ruby on Rails app with Zapier using the REST hooks pattern. With support for triggering the REST hooks from Resque background jobs.
class Contact < ActiveRecord::Base
...
def after_create
if Hook.hooks_exist?('new_contact', self)
Resque.enqueue(Hook, self.class.name, self.id)
# To trigger directly without Resque: Hook.trigger('new_contact', self)
end
end
@joshfreemanIO
joshfreemanIO / konamicode.js
Created March 2, 2013 01:49
Plays the Metal Gear Solid "Alert" sound when the Konami Code is entered. Modify path to local instance of the sound file.
counter = 0;
window.onkeydown = function(e){konamicode(e.which)}
function konamicode(button)
{
var code = new Array(38,38,40,40,37,39,37,39,66,65);
if(code[counter] === button)
{