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
(function() { | |
const events = new Map(); | |
const stopped = new WeakMap(); | |
function before(subject, verb, fn) { | |
const source = subject[verb]; | |
subject[verb] = function() { | |
fn.apply(subject, arguments); | |
return source.apply(subject, arguments); | |
}; |
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
xcode-select --install | |
if [ ! -x /opt/homebrew/bin/brew ]; then | |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | |
fi | |
brew tap 'homebrew/bundle' | |
brew tap 'homebrew/services' | |
brew install automake clang-format cmake icu4c libressl libxml2 openssl pkg-config readline sqlite yajl |
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
#include <stdio.h> | |
#define MAX 100000000 | |
int calculate() { | |
int sum = 0; | |
for (int i = 0; i < 10; i++) { | |
sum += i; | |
} | |
return sum; |
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
// Compile without optimizations: | |
// cc -S -O0 -masm=intel const-expr.c | |
// Compile with optimizations: | |
// cc -S -O3 -masm=intel const-expr.c | |
int main() { | |
int x = 11; | |
int y = 12; | |
int z = x + y; | |
return z; | |
} |
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 "minitest/autorun" | |
class RangeSet | |
include Enumerable | |
def initialize(ranges = []) | |
@ranges = merge(ranges) | |
end | |
def <<(range) |
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
#!/bin/sh | |
if [ "$1" = "--stop" ] | |
then | |
git config --unset-all cowork.author | |
elif [ -n "$1" ] | |
then | |
author=$(git log --no-merges --author "$1" -1 --pretty="%an <%ae>") | |
if [ -n "$author" ] | |
then |
OlderNewer