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
# === Use a specific python version (with pyenv) === | |
# Usage in .envrc: | |
# use python <version> | |
use_python() { | |
if has pyenv; then | |
local pyversion=$1 | |
eval "$(pyenv init --path)" | |
eval "$(pyenv init -)" | |
pyenv local ${pyversion} || log_error "Could not find pyenv version '${pyversion}'. Consider running 'pyenv install ${pyversion}'" | |
fi |
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 {Injectable} from '@angular/core'; | |
import {LoggerService} from './logger.service'; | |
import {environment} from '../../../environments/environment'; | |
import {LoggerProperties} from './logger-config'; | |
@Injectable({ | |
providedIn: 'root' | |
}) | |
export class ConsoleLoggerService implements LoggerService { | |
enableInfo: boolean; |
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
from typing import List | |
all_tiles = dict() | |
vector_map = { | |
'ne': (1, 1), | |
'nw': (-1, 1), | |
'e': (2, 0), | |
'w': (-2, 0), | |
'sw': (-1, -1), | |
'se': (1, -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
from typing import List | |
all_tiles = dict() | |
vector_map = { | |
'ne': (1, 1), | |
'nw': (-1, 1), | |
'e': (2, 0), | |
'w': (-2, 0), | |
'sw': (-1, -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
from typing import List | |
class Link: | |
def __init__(self, cup_num, next_link=None): | |
self.cup_num: int = cup_num | |
self.next_link: Link = next_link | |
self.terminator = False | |
def __repr__(self): |
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
from typing import List | |
def parse_decks(f): | |
player1_deck = [] | |
player2_deck = [] | |
current_deck = player1_deck | |
for line in f.readlines(): | |
if line == '' or line == "\n" or line.lower().startswith('player 1'): | |
continue |
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
from copy import deepcopy | |
import math | |
from typing import List, Set | |
def join(itr): | |
return "".join(itr) | |
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 | |
mdfind "kMDItemKind == 'Alias'" -onlyin /Applications/ | while read x ; do rm -f "$x" ; done | |
find /usr/local/Caskroom -name "*.app" | grep -E "/latest/[^/]*.app$" | while read x ; do | |
echo "$x" | |
SHORT=`echo $x | sed s/.app//g | sed 's/.*\/latest\///g' | sed 's/ /_/g' | awk '{print tolower($0)}' ` | |
echo "$SHORT" | |
osascript<<EOF | |
set $SHORT to POSIX file "$x" | |
set applications_folder to POSIX file "/Applications" |