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 class lets you enqueue class methods with Delayed Job | |
# For Rails, name this delayed_profit.rb and put it in your app/models directory | |
# For the others, do what you do to load files | |
# Usage: Assuming Notifier is your ActionMailer class then ... | |
# Delayed::Job.enqueue DelayedProfit.new(Notifier, | |
# :deliver_profit_notification, 'hey!', 'we profitted') | |
# This causes Delayed Job to execute | |
# Notifier.deliver_profit_notification('hey!', 'we profitted') | |
class DelayedProfit |
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 | |
# Example create project on kanbanpad api using json | |
# Runs on PHP 5.3 with curl and json extension | |
# Note the https, the s is required. | |
$curl = curl_init("https://www.kanbanpad.com/api/v1/projects.json"); | |
curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); | |
curl_setopt($curl, CURLOPT_USERPWD, '[email protected]:e754f5335230f9bad9b5dc90ceb5ab0c76a06604'); | |
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); | |
curl_setopt($curl, CURLOPT_POST, 1); |
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
00000000:http.accept(0003)=0004 from [127.0.0.1:49647] | |
00000000:http.clireq[0004:ffff]: POST /upload.json HTTP/1.1 | |
00000000:http.clihdr[0004:ffff]: Host: localhost:9090 | |
00000000:http.clihdr[0004:ffff]: Connection: keep-alive | |
00000000:http.clihdr[0004:ffff]: Content-Length: 201199 | |
00000000:http.clihdr[0004:ffff]: Cache-Control: max-age=0 | |
00000000:http.clihdr[0004:ffff]: Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 | |
00000000:http.clihdr[0004:ffff]: Origin: null | |
00000000:http.clihdr[0004:ffff]: User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.65 Safari/537.31 | |
00000000:http.clihdr[0004:ffff]: Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryW77NGtHaHWUON4G7 |
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
# Based on http://www.jonathanleighton.com/articles/2011/awesome-active-record-bug-reports/ | |
# Run this script with `$ ruby my_script.rb` | |
require 'sqlite3' | |
require 'active_record' | |
# Use `binding.pry` anywhere in this script for easy debugging | |
require 'pry' | |
# Connect to an in-memory sqlite3 database |