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 -eo pipefail | |
OUTPUT_DIR=output | |
mkdir -p $OUTPUT_DIR | |
resources=($(kubectl api-resources | tail -n +2 | awk '{ print $1 }')) | |
ignore=("bindings" "tokenreviews" "localsubjectaccessreviews" "selfsubjectaccessreviews" "selfsubjectrulesreviews" "subjectaccessreviews") |
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 dropbox | |
import ( | |
"crypto/sha256" | |
"fmt" | |
"os" | |
"github.com/pkg/errors" | |
) |
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 semver_compare | |
is_greater_or_equal(a, b) = result { | |
result := { | |
is_greater(a, b), | |
is_equal(a, b), | |
} & { true } == { true } | |
} | |
is_lesser_or_equal(a, b) = result { | |
result := { |
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 | |
# run safe_flatten for each in folder | |
set -eo pipefail | |
root_dir=$1 | |
if [ -z "$root_dir" ] | |
then |
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 "open-uri" | |
require "csv" | |
require "nokogiri" | |
require "pry" | |
csv_string = CSV.generate do |csv| | |
# this is the max number of pages with data on the-numbers.com | |
(1..5401).step(100).each do |page| | |
puts page | |
doc = Nokogiri::HTML(open("http://www.the-numbers.com/movie/budgets/all/#{page}").read) |
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
func main() { | |
// let's parse some youarells | |
url1, _ := url.Parse("http://www.example.com") | |
url2, _ := url.Parse("www.example.com") | |
// oops, this the second one needs a scheme, let's set one: | |
url2.Scheme = "http" | |
// perfect - now my urls are the same | |
fmt.Println(url1.String()) // => http://www.example.com |
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 ( | |
"bytes" | |
"fmt" | |
"math/rand" | |
"os" | |
"os/exec" | |
"strconv" | |
"strings" |
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
# intended for heroku daily scheduler | |
require "open-uri" | |
require "json" | |
require "pushover" | |
require "pry" | |
repos = { | |
"user/repo" => "tag" |
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
FROM java:8 | |
RUN curl http://nlp.stanford.edu/software/stanford-corenlp-full-2015-12-09.zip > corenlp.zip | |
RUN unzip corenlp.zip -d /corenlp | |
RUN mv /corenlp/*/* /corenlp | |
WORKDIR /corenlp | |
RUN export CLASSPATH="`find . -name '*.jar'`" | |
EXPOSE 9000 | |
CMD java -cp "*" -mx4g edu.stanford.nlp.pipeline.StanfordCoreNLPServer |
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
[{"from":{"lat":"51.502500","lon":"-0.278126","name":"Acton Town"},"to":{"lat":"51.517675","lon":"-0.0824580","name":"Liverpool Street"},"time":46.05,"legs":5},{"from":{"lat":"51.50856013","lon":"-0.262879534","name":"Acton Central"},"to":{"lat":"51.517675","lon":"-0.0824580","name":"Liverpool Street"},"time":52.65,"legs":3},{"from":{"lat":"51.51394","lon":"-0.07537","name":"Aldgate"},"to":{"lat":"51.517675","lon":"-0.0824580","name":"Liverpool Street"},"time":7.483333333333333,"legs":3},{"from":{"lat":"51.51514","lon":"-0.07178","name":"Aldgate East"},"to":{"lat":"51.517675","lon":"-0.0824580","name":"Liverpool Street"},"time":10.8,"legs":3},{"from":{"lat":"51.54097","lon":"-0.30061","name":"Alperton"},"to":{"lat":"51.517675","lon":"-0.0824580","name":"Liverpool Street"},"time":56.25,"legs":3},{"from":{"lat":"51.67435","lon":"-0.60732","name":"Amersham"},"to":{"lat":"51.517675","lon":"-0.0824580","name":"Liverpool Street"},"time":75.75,"legs":5},{"from":{"lat":"51.53253","lon":"-0.10579","name":"Angel"},"to" |
NewerOlder