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 dataclasses import dataclass | |
@dataclass(frozen=True) | |
class Var: | |
name: str | |
@dataclass(frozen=True) | |
class Int: |
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 aiohttp | |
import asyncio | |
async def download(session, url, file): | |
async with session.get(url) as res: | |
with open(file, "wb") as f: | |
f.write(await res.read()) | |
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 Foundation | |
final class FileIO { | |
private let buffer:[UInt8] | |
private var index: Int = 0 | |
init(fileHandle: FileHandle = FileHandle.standardInput) { | |
buffer = Array(try! fileHandle.readToEnd()!)+[UInt8(0)] // 인덱스 범위 넘어가는 것 방지 |
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
// | |
// CGPoint+offsetBy.swift | |
// | |
// Created by Jay Lee on 29/01/2019. | |
// Copyright © 2019 Jay Lee <jaeho.lee@snu.ac.kr> | |
// This work is free. You can redistribute it and/or modify it under the | |
// terms of the Do What The Fuck You Want To Public License, Version 2, | |
// as published by Sam Hocevar. See http://www.wtfpl.net/ for more details. | |
// |
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
void drawShifted( | |
path g, | |
pair trueshift, | |
picture pic=currentpicture, | |
Label label="", | |
pen pen=currentpen, | |
arrowbar arrow=None, | |
arrowbar bar=None, | |
margin margin=NoMargin, | |
marker marker=nomarker |
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
void pathLabel( | |
picture pic=currentpicture, | |
Label l, | |
path g, | |
real position=0.5, | |
align align=NoAlign, | |
bool sloped=false, | |
pen p=currentpen, | |
filltype filltype=NoFill | |
) { |
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 builder to safely make objects | |
function build_complex(r, i) | |
return {real = r, img = i} | |
end | |
-- Accessing a value with a key | |
complex = build_complex(3, 4) | |
assert(complex["real"] == complex.real) | |
print(complex.real) |
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
function enable_counting() | |
local count = 0 | |
local old_print = print | |
print = function(...) | |
count = count + 1 | |
old_print(...) | |
end | |
return function() return count end | |
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
ffmpeg -i ~/lecture-videos/week1_edit.mov -ss 00:00:00 -t 00:13:00 ~/lecture-videos/week1_edit_part1.mp4 | |
ffmpeg -ss 00:10:00 -i ~/lecture-videos/week1_edit.mov -t 00:13:00 ~/lecture-videos/week1_edit_part2.mp4 | |
ffmpeg -ss 00:20:00 -i ~/lecture-videos/week1_edit.mov -t 00:13:00 ~/lecture-videos/week1_edit_part3.mp4 | |
ffmpeg -ss 00:27:00 -i ~/lecture-videos/week1_edit.mov -t 00:13:44 ~/lecture-videos/week1_edit_part4.mp4 | |
ffmpeg -ss 00:00:00 -i ~/lecture-videos/week2_edit.mov -t 00:13:00 ~/lecture-videos/week2_edit_part1.mp4 | |
ffmpeg -ss 00:10:00 -i ~/lecture-videos/week2_edit.mov -t 00:13:00 ~/lecture-videos/week2_edit_part2.mp4 | |
ffmpeg -ss 00:20:00 -i ~/lecture-videos/week2_edit.mov -t 00:13:00 ~/lecture-videos/week2_edit_part3.mp4 | |
ffmpeg -ss 00:25:00 -i ~/lecture-videos/week2_edit.mov -t 00:13:26 ~/lecture-videos/week2_edit_part4.mp4 |
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 | |
# tput variables | |
highlight=$(tput setaf 3; tput bold) | |
alert=$(tput setaf 1) | |
reset=$(tput sgr0) | |
# Install Xcode Command Line Tools | |
echo "${highlight}Installing Xcode Command Line Tools...${reset}" | |
xcode-select -p > /dev/null |