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
| package main | |
| import ( | |
| "fmt" | |
| "math/rand" | |
| ) | |
| func fill(size int) []int { | |
| slice := make([]int, 0, size) | |
| for i := 0; i < size; i++ { |
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
| package main | |
| import ( | |
| "fmt" | |
| "sync" | |
| ) | |
| type Fetcher interface { | |
| // Fetch returns the body of URL and | |
| // a slice of URLs found on that page. |
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 \ | |
| -o nounset \ | |
| -o pipefail \ | |
| -o errexit | |
| tags=$(doctl compute tag list --output json | jq -r '.[].name') | |
| aggregate=$(jq -n '{ "_meta": { "hostvars": { } } }') |
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 \ | |
| -o nounset \ | |
| -o pipefail \ | |
| -o errexit \ | |
| -o errtrace \ | |
| -o verbose \ | |
| -o xtrace |
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
| # Create users table and apply indices. | |
| class CreateUsers < ActiveRecord::Migration[5.0] | |
| def change | |
| create_table :users, force: true, id: false, primary_key: 'id' do |t| | |
| t.binary :id, default: 'uuid_v4()' | |
| t.string :login, null: false | |
| t.string :email, null: false | |
| end | |
| add_index :users, :login, unique: true | |
| add_index :users, :email, unique: true |
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
| O Romeo, Romeo, wherefore art thou Romeo? | |
| Some people feel the rain, while others just get wet. | |
| ffff ----- '''''' D'd-d'-dd'-dd-' d'd-d'-dd'-dd-' |
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
| - name: create load balancer | |
| ec2_elb_lb: | |
| name: '{{ application }}-{{ item.name }}-elb' | |
| region: '{{ region }}' | |
| connection_draining_timeout: 60 | |
| cross_az_load_balancing: yes | |
| health_check: | |
| ping_protocol: http | |
| ping_port: 80 | |
| ping_path: '{{ item.elb_ping_path|default("/") }}' |
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
| - name: create load balancer | |
| ec2_elb_lb: | |
| name: '{{ application }}-{{ item.name }}-elb' | |
| region: '{{ region }}' | |
| connection_draining_timeout: 60 | |
| cross_az_load_balancing: yes | |
| health_check: | |
| ping_protocol: http | |
| ping_port: 80 | |
| ping_path: '{{ item.elb_ping_path|default("/") }}' |
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
| bluetooth.lookup_name('10:53:2F:CA:FC:58') |
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
| import bluetooth | |
| nearby_devices = bluetooth.discover_devices( | |
| duration=8, lookup_names=True, flush_cache=True, lookup_class=False | |
| ) | |
| for addr, name in nearby_devices: | |
| print("%s - %s" % (addr, name)) |