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
// Adapted from https://developers.google.com/apps-script/articles/vacation-calendar | |
var TEAM_CALENDAR_ID = 'c_xxxxxxxxxxxx@group.calendar.google.com'; | |
var MONTHS_IN_ADVANCE = 2; | |
var WHOLE_DAY_HOURS_THRESHOLD = 6; | |
var USER_EMAILS = [ | |
]; | |
// The maximum script run time under Apps Script Pro is 30 minutes; this setting | |
// will be used to report when the script is about to reach that limit. |
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" | |
"math/rand" | |
"strings" | |
"testing" | |
) | |
const alphabet = "abcdefghijklmnopqrstuvwxyz0123456789" |
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 "testing" | |
var list []*struct{} | |
func init() { | |
for i := 0; i < 1000; i++ { | |
list = append(list, nil) | |
} |
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 KeywordCurry | |
def initialize | |
@vars = {} | |
end | |
def with_argument(name, val) | |
d = self.dup | |
d.bind_argument(name.to_sym, val) | |
d | |
end |
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
#!/usr/bin/env ruby | |
require 'open3' | |
module CheckGitNoModif | |
class << self | |
def call(*argv) | |
case argv.size | |
when 1 | |
if system("git rev-parse --git-dir >/dev/null 2>&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
#!/usr/bin/env ruby | |
require 'open3' | |
module CheckstyleToJUnit | |
# https://github.com/koalaman/shellcheck/wiki/JUnit | |
XSLT = File.expand_path('../support/checkstyle2junit.xslt', __dir__) | |
class << self | |
def call |
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
#!/usr/bin/env ruby | |
# Input: | |
# { | |
# "Issues": [ | |
# { | |
# "FromLinter": "gofmt", | |
# "Text": "File is not `gofmt`-ed with `-s`", | |
# "Pos": { | |
# "Filename": "shell/shell.go", |
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
require 'benchmark' | |
size = 100 | |
list = [] | |
size.times { |i| list << {name: "item #{i}"} } | |
n = 5000 | |
Benchmark.bmbm(16) do |bm| | |
bm.report('each_with_object') { n.times { list.each_with_object({}) { |item, map| map[item[:name]] = item } } } | |
bm.report('inject+merge') { n.times { list.inject({}) { |map, item| map.merge(item[:name] => item) } } } |
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 | |
# Example: | |
# $ explode-path ~ | |
# / | |
# /Users | |
# /Users/seb | |
# Great for recursively checking permissions |
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
``` | |
$ time GIT_TRACE=1 git -c http.proxy=http://localhost:8888 clone --mirror https://github.com/Shopify/shopify.git /tmp/g.git | |
10:45:42.059182 git.c:415 trace: built-in: git clone --mirror https://github.com/Shopify/shopify.git /tmp/g.git | |
Cloning into bare repository '/tmp/g.git'... | |
10:45:42.071336 run-command.c:637 trace: run_command: git-remote-galaxy origin Shopify/shopify.git | |
10:45:42.152772 git.c:415 trace: built-in: git config --get remote.origin.url | |
10:45:42.168087 git.c:415 trace: built-in: git config --get remote.origin.pushurl | |
10:45:42.193176 git.c:415 trace: built-in: git config --get user.email | |
10:45:42.199199 git.c:659 trace: exec: git-remote-http origin https://git-mirror.shopifycloud.com/Shopify/shopify.git | |
10:45:42.199637 run-command.c:637 trace: run_command: git-remote-http origin https://git-mirror.shopifycloud.com/Shopify/shopify.git |
NewerOlder