type Vertex struct {
Lat, Long float64
}
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
apiVersion: policy/v1beta1 | |
kind: PodSecurityPolicy | |
metadata: | |
name: developers-psp | |
spec: | |
privileged: false | |
allowPrivilegeEscalation: false | |
hostNetwork: false | |
hostPID: false | |
hostIPC: false |
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
#!/bin/bash | |
# Install the Build and Test Dependencies | |
apt-get update | |
apt-get install -y curl build-essential tcl | |
# Download and Extract the Source Code | |
cd /tmp | |
curl -O http://download.redis.io/redis-stable.tar.gz | |
tar xzvf redis-stable.tar.gz |
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
#!/bin/bash | |
# Usage: clusterctl start|stop | |
# | |
# Launches a local RabbitMQ cluster | |
# | |
# The name returned by `hostname -s` must resolve to 127.0.0.1 | |
CLUSTER_SIZE=4 | |
NODENAME_PREFIX='rmq' |
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
package main | |
import ( | |
"fmt" | |
"labix.org/v2/mgo" | |
"labix.org/v2/mgo/bson" | |
"time" | |
) | |
type Person struct { |
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
# Threaded delayed_job. Useful for Heroku where each process/dyno costs money. | |
# run "rake jobs:threaded_work[4]" to start 4 worker threads | |
namespace :jobs do | |
desc "Start several delayed_job workers." | |
task :threaded_work, [:num_workers] => :environment do |t,args| | |
args.with_defaults(:num_workers => 1) | |
threads = [] | |
workers = [] | |
workersSemaphore = Mutex.new |
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
#!/bin/bash | |
function jsonval { | |
temp=`echo $json | sed 's/\\\\\//\//g' | sed 's/[{}]//g' | awk -v k="text" '{n=split($0,a,","); for (i=1; i<=n; i++) print a[i]}' | sed 's/\"\:\"/\|/g' | sed 's/[\,]/ /g' | sed 's/\"//g' | grep -w $prop` | |
echo ${temp##*|} | |
} | |
json=`curl -s -X GET http://twitter.com/users/show/$1.json` | |
prop='profile_image_url' | |
picurl=`jsonval` |
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
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |