-
Packer change entrypoint. This is obscure if you are just trying packer. You can read this here
-
Packer doesn't work with scratch/distroless images(and another without bash) If your docker image has no bash packer does not build your image. See here
-
Packer has no some docker command like copy. See here
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
const BOM = '\ufffe' //LE. for BE '\ufeff' | |
func createFile(name string) error { | |
var bytes [2]byte | |
data := `test string UTF-8` | |
file, err := os.Create(name) | |
if err != nil { | |
fmt.Errorf("Can't open file. %v", err) | |
return err |
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
# Best O(1) | |
# Worst O(long n) | |
arr = [1,2,3,4,5,6,7,10] | |
def bs (list, elem) | |
low = 0 | |
high = list.length | |
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
# O(|V|+|E|) | |
graph = Hash.new | |
graph["you"] = ["alice", "bob", "claire"] | |
graph["bob"] = ["anuj", "peggy"] | |
graph["alice"] = ["peggy"] | |
graph["claire"] = ["thom", "jonny"] | |
graph["anuj"] = [] | |
graph["peggy"] = [] | |
graph["thom"] = [] |
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 | |
// worst n^2 | |
// best n | |
import ( | |
"fmt" | |
) | |
func main() { | |
arr := []int{2,5,4,-8,9,1} |
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
memo = Hash.new(0) | |
def fib_rec (number, memo) | |
if number == 0 | |
return number | |
elsif (number == 1) || (number == 2) | |
return 1 | |
end | |
if (memo.has_key?(number)) | |
return memo[number] |
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
# O(n^2) | |
def insertion_sort arr | |
i = 0 | |
j = 0 | |
for i in 1...(arr.length) do | |
key = arr[i] | |
j = i - 1 | |
while j >= 0 and key < arr[j] do | |
arr[j + 1] = arr[j] |
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
def solve(n, a, b, c): | |
if n > 0: | |
solve(n - 1, a, c, b) | |
print('Move disk from ' + a + ' to disk ' + b) | |
solve(n - 1, c, b, a) | |
solve(3, '1', '2', '3') |
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
# O(n log(log n)) | |
arr = list(range(0, 300)) | |
def sieve(ar): | |
for i in ar: | |
if i > 1: | |
step = arr[i] | |
while (arr[i] + step) < len(arr): |
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
def is_simple(digit): | |
for i in range(2, digit - 1): | |
if ((digit % i) == 0): | |
return False | |
else: | |
return True | |
print(is_simple(72)) # False | |
print(is_simple(73)) # True |
NewerOlder