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
Vagrant.configure("2") do |config| | |
config.vm.box = "ubuntu/xenial64" | |
config.vm.provision "shell", inline: <<-SHELL | |
sudo apt-get update | |
sudo apt-get install -y \ | |
apt-transport-https \ | |
ca-certificates \ | |
curl \ | |
software-properties-common | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - |
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
$ kubectl describe job rails-example-app-migration-hxptn | |
Name: rails-example-app-migration-hxptn | |
Namespace: default | |
Selector: controller-uid=3bfd8456-7b07-11e8-b4ff-42010a9c0106 | |
Labels: controller-uid=3bfd8456-7b07-11e8-b4ff-42010a9c0106 | |
job-name=rails-example-app-migration-hxptn | |
Annotations: <none> | |
Parallelism: 1 | |
Completions: 1 | |
Start Time: Thu, 28 Jun 2018 21:12:43 +0200 |
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
releases: | |
- name: redis-sandbox | |
chart: stable/redis | |
values: | |
- redis.yml | |
- name: postgres-sandbox | |
chart: stable/postgresql | |
values: | |
- postgres.yml |
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
ExUnit.start | |
defmodule EtsAssertion do | |
use ExUnit.Case | |
test "ets" do | |
:ets.new(:table, [:named_table, :bag]) | |
:ets.insert(:table, [{:items, :a, :b, :c}, {:items, :a, :x, :x}]) | |
result = :ets.match(:table, {:items, '$1', '$2', '_'}) | |
assert result == [[:a, :b],[:a, :x]] |
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
# Requires `brew install ag` | |
dirname = ARGV[0] | |
records = Dir.glob(File.join(dirname, "**/*")) | |
possible_extensions = %w(jpeg jpg svg gif png css scss js coffee htc ejs jst).map{|ext| ".#{ext}"} | |
names = records. | |
reject{|path| File.directory?(path) }. | |
reject{|path| path =~ /@2x/}. | |
map do |path| |
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
# Requires `brew install ag` | |
dirname = ARGV[0] | |
records = Dir.glob(File.join(dirname, "**/*")) | |
possible_extensions = %w(jpeg jpg svg gif png css scss js coffee htc ejs jst).map{|ext| ".#{ext}"} | |
names = records.reject{|path| File.directory?(path) }.map do |path| | |
name = File.basename path | |
while true | |
ext = File.extname(name) |
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
occurrences |
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
vagrant@precise64:/vagrant$ sudo apt-get install libexif-dev | |
Reading package lists... Done | |
Building dependency tree | |
Reading state information... Done | |
The following extra packages will be installed: | |
libexif12 libjs-jquery | |
Suggested packages: | |
javascript-common | |
The following NEW packages will be installed: | |
libexif-dev libexif12 libjs-jquery |
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
module Mastermind | |
class Color < Struct.new(:symbol) | |
def to_s | |
symbol.to_s | |
end | |
end | |
class Colors < Array | |
def all_possibilities(pegs_count) | |
repeated_permutation(pegs_count).map do |c| |
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
//FightCode can only understand your robot | |
//if its class is called Robot | |
var Robot = function(robot) { | |
var rx = robot.position.x; | |
var ry = robot.position.y; | |
var aH = robot.arenaHeight; | |
var aW = robot.arenaWidth; | |
robot.clone() | |
}; |
NewerOlder