This was a challenge to demonstrate how the content-type header can be used to fool the browser into treating the HTTP response body in unexpected ways.
As the harder solution works for both, heres source:
php
require "net/http" | |
require "json" | |
class Pipeline < BasicObject | |
def self.start | |
new | |
end | |
def initialize |
function myFunction() { | |
var sheet = SpreadsheetApp.getActiveSheet(); | |
var calendar = CalendarApp.getDefaultCalendar(); | |
var from = new Date(); | |
// 今から60分後にかぶる予定をさがす | |
var to = new Date(from.getTime() + (1000 * 60 * 60)); | |
// このURLを自分のものに直してね | |
var link = "https://www.remotty.net/rooms/1/bot/message.json?(twitter用の奴と同じクエリ)"; | |
var events = calendar.getEvents( from , to ); | |
if (events.length > 0){ |
class User < ActiveRecord::Base | |
has_secure_password | |
validates :email, presence: true, uniqueness: true | |
validates :password, length: { minimum: 6, if: ->(u) { u.password.present? } } | |
end |
#!/bin/sh | |
# if you're using ZSH, change the shebang above to "#!/bin/zsh -i" | |
if [ ${#} -ne 2 ]; then | |
echo >&2 Usage: $(basename ${0}) old-version new-version | |
exit 1 | |
fi | |
home_path=$(cd ~; pwd -P) | |
old_version=${1} |
-- show running queries (pre 9.2) | |
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |