This file contains hidden or 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 bash | |
set -euo pipefail | |
for AWS_REGION in $(aws ec2 describe-regions --region eu-west-1 --query '[Regions[].RegionName]' --output text); do | |
echo -n "* Region ${AWS_REGION}: " | |
export AWS_REGION | |
# get default vpc | |
vpc=$(aws ec2 describe-vpcs --filter Name=isDefault,Values=true --query "Vpcs[0].VpcId" --output text) |
This file contains hidden or 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
- (uint8_t *)SHA256; |
This file contains hidden or 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
craig@zuu 0 ruby-1.9.3-p194 ~$ ruby ./example.rb 2>example.err 1>example.out | |
craig@zuu 0 ruby-1.9.3-p194 ~$ cat example.err | |
STDERR | |
craig@zuu 0 ruby-1.9.3-p194 ~$ cat example.out | |
STDOUT |
This file contains hidden or 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
before: | |
def process_message message | |
logger.debug "Started #{message.headers["message-id"]}" | |
event = JSON.parse message.body | |
logger.debug "Action: #{event['action']}" | |
match_id = event['matchID'] | |
active_entries = PassingGame::Entry.count_active_for match_id | |
logger.info "#{active_entries} active entries for match_id = #{match_id}" | |
if fail_on? event |
This file contains hidden or 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
<div class="actions left"> | |
<h3>Home</h3> | |
<% @home_actions.each do |player_action| %> | |
<%=h player_action.inspect %><br /> | |
<% end %> | |
</div> | |
<div class="actions right"> | |
<h3>Away</h3> | |
This file contains hidden or 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
# how to test that this works? | |
# or would you even bother? | |
... | |
begin | |
require 'system_timer' | |
rescue LoadError | |
require 'timeout' | |
SystemTimer = Timeout |
This file contains hidden or 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('http') | |
.createServer(function(request, response){ | |
setTimeout(function() { | |
response.sendHeader(200, {'Content-Type' : 'text/plain'}); | |
response.sendBody("zoom"); | |
response.finish(); | |
}, 2000); | |
}) | |
.listen(8000); |
This file contains hidden or 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 | |
abstract class Model { | |
static abstract function getFields(); | |
static function getFieldsForSQL() { | |
return implode(', ', self::getFields()); | |
} | |
static function getAll() { |
This file contains hidden or 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 | |
abstract class Model { | |
static abstract function getFields(); | |
static function getFieldsForSQL() { | |
return implode(', ', self::getFields()); | |
} | |
static function getAll() { |
This file contains hidden or 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
# Ruby tends to pass by reference. | |
# http://groups.google.com/group/ruby-talk-google/msg/aa5cdea350f46314 | |
# | |
# Notice all the same object ID in the output. | |
# | |
class Test | |
def self.test | |
hash = {:entry => ""} | |
array = [] |
NewerOlder