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 | |
export ANT_HOME=~/Downloads/apache-ant-1.9.16 | |
export PATH=$JAVA_HOME/bin:$ANT_HOME/bin:$PATH | |
export ANT_OPTS="-Xmx4096m" | |
export CLDR_DIR=~/workspace/unicode-org/cldr | |
export ICU4C_DIR=~/workspace/unicode-org/icu/icu4c | |
export ICU4J_ROOT=~/workspace/unicode-org/icu/icu4j | |
export TOOLS_ROOT=~/workspace/unicode-org/icu/tools | |
export CLDR_TMP_DIR=$CLDR_DIR/../cldr-staging |
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 | |
wget https://cache.ruby-lang.org/pub/ruby/3.0/ruby-3.0.2.tar.gz | |
tar -zxvf ruby-3.0.2.tar.gz | |
cd ruby-3.0.2 | |
./configure --prefix=/tmp \ | |
--build=x86_64-apple-darwin20 \ | |
--target=aarch64-apple-darwin20 \ |
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 fs = require('fs') | |
const { createAppAuth } = require('@octokit/auth-app') | |
async function main() { | |
const auth = createAppAuth({ | |
appId: 905201, | |
privateKey: fs.readFileSync('/path/to/private-key.pem', 'utf8') | |
}); | |
const appAuth = await auth({ |
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
# frozen_string_literal: true | |
branches = `git branch`.strip.split("\n").map(&:strip).reject { |b| b.start_with?("*") } | |
branches.each_with_index do |branch, idx| | |
STDOUT.write("[#{idx + 1}/#{branches.size}] Delete '#{branch}' (y/n)? ") | |
answer = gets | |
if answer.strip =~ /[yY]/ | |
system("git branch -D #{branch}") |
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
# frozen_string_literal: true | |
require "benchmark/ips" | |
require "allocation_stats" | |
require "/Users/camertron/workspace/camertron/vitesse/ext/vitesse/vitesse" | |
TIMES = 100 | |
actionview_trace = AllocationStats.trace do | |
output_buffer = ActionView::OutputBuffer.new |
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 | |
# Usage: gifify.sh <input file> <output file> | |
ffmpeg -i $1 -vf "fps=10,scale=320:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" $2 |
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 'shellwords' | |
$cache = {} | |
def file_sizes_in(path) | |
$cache[path] ||= begin | |
raw = `du -d 1 2>/dev/null #{Shellwords.shellescape(path)}` | |
# exclude current dir |
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 | |
# First, install Xcode and accompanying command-line tools | |
wget https://cache.ruby-lang.org/pub/ruby/3.0/ruby-3.0.2.tar.gz | |
tar -zxvf ruby-3.0.2.tar.gz | |
cd ruby-3.0.2 | |
./configure --prefix=/tmp \ |
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
Single-threaded | |
┌───────┬─────────────────────┬──────────┬────────────────────────────────────────────┬────────┬───────────┬─────────┬───────────┬──────────┬──────┬───────────────┐ | |
│ Index │ Implementation │ Solution │ Label │ Passes │ Duration │ Threads │ Algorithm │ Faithful │ Bits │ Passes/Second │ | |
├───────┼─────────────────────┼──────────┼────────────────────────────────────────────┼────────┼───────────┼─────────┼───────────┼──────────┼──────┼───────────────┤ | |
│ 1 │ PrimeCPP │ 3 │ flo80_constexpr │ 37737 │ 5.00010 │ 1 │ base │ no │ 1 │ 7547.25207 │ | |
│ 2 │ PrimeCython │ 1 │ ssovest-cy │ 20838 │ 5.00015 │ 1 │ other │ yes │ 1 │ 4167.47164 │ | |
│ 3 │ PrimeC │ 2 │ danielspaangberg_5760of30030_owrb │ 20255 │ 5.00021 │ |
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
import unittest | |
def enum(obj): | |
if type(obj) == list: | |
return EnumList(obj) | |
elif type(obj) == dict: | |
return EnumDict(obj) | |
class Enumerable(object): | |
def each(self, cb): |
NewerOlder