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
# typed: false | |
# frozen_string_literal: true | |
require "bundler" | |
require "antlr4-native" | |
require "etc" | |
require "rubygems/package" | |
require "zlib" | |
require "open-uri" |
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 |
NewerOlder