Skip to content

Instantly share code, notes, and snippets.

View Avantgarde95's full-sized avatar
๐Ÿ˜บ
Working

Hunmin Park Avantgarde95

๐Ÿ˜บ
Working
View GitHub Profile
@Avantgarde95
Avantgarde95 / 2018.py
Last active January 11, 2024 19:14
cs1robots 2018
import cs1robots as cs
import time
# patch some methods
def add_beeper(self, av, st, num=None):
if num is None:
self.beepers[(av, st)] = 1
else:
self.beepers[(av, st)] = num
@Avantgarde95
Avantgarde95 / eigen_2.py
Created January 16, 2018 07:54
Eigenvalue of 2-dimensional matrix (in python)
import math
# =============================================================
# 2-dimensional matrix
class Matrix:
"""| 1 2 | -> Matrix([1, 2, 3, 4])
| 3 4 |
"""
def __init__(self, elems):
@Avantgarde95
Avantgarde95 / tree-output.txt
Created March 28, 2018 05:02
CopyTree (Copyable tree implementation)
Original:
A: (0, 0, 0)
|-B: (0, 0, 0)
|-D: (0, 0, 0)
|-F: (1, 0, 0)
|-G: (2, 0, 0)
|-E: (0, 0, 0)
|-C: (0, 0, 0)
|-H: (0, 1, 0)
|-I: (0, 2, 0)
@Avantgarde95
Avantgarde95 / chuseok.cpp
Created September 26, 2018 21:07
Chuseok
#include <iostream>
#include <string>
#include <vector>
#include <chrono>
#include <thread>
#include <cmath>
template<typename T>
int cut(T value, int bottom, int top) {
int intValue = static_cast<int>(value);
@Avantgarde95
Avantgarde95 / FlyCamera.cs
Created April 12, 2019 08:39 — forked from gunderson/FlyCamera.cs
Unity Script to give camera WASD + mouse control
using UnityEngine;
using System.Collections;
public class FlyCamera : MonoBehaviour {
/*
Writen by Windexglow 11-13-10. Use it, edit it, steal it I don't care.
Converted to C# 27-02-13 - no credit wanted.
Simple flycam I made, since I couldn't find any others made public.
Made simple to use (drag and drop, done) for regular keyboard layout
@Avantgarde95
Avantgarde95 / happynewyear.js
Created December 31, 2019 14:37
Happy new year 2020!
var w = 31;
var ct = 0;
var ic = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor);
function rp(s, n) {
var line = "";
var i;
for (i = 0; i < n; i++) {
line += s;
pragma solidity ^0.5.7;
contract BC3D {
// ======================================================
// Types.
struct Project {
bytes32 id;
string name;
string keyword;
@Avantgarde95
Avantgarde95 / imdbtest.py
Last active October 29, 2020 02:36
imdbpy test
# pip install imdbpy๋กœ imdbpy ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์„ค์น˜ํ•ด์•ผ๋จ.
# (์•ˆ ๋˜๋ฉด python -m pip install imdbpy)
from imdb import IMDb
def printMovie(movie):
# movie['title']: ์ œ๋ชฉ๋งŒ, movie['long imdb title']: ์—ฐ๋„๋„ ๊ฐ™์ด.
title = movie['long imdb title']
movieID = movie.movieID
@Avantgarde95
Avantgarde95 / extractmyworks.py
Last active December 11, 2021 22:44
Tmax weekly ์ถ”์ถœ ์Šคํฌ๋ฆฝํŠธ
'''์ง€์ •ํ•œ ํด๋”์˜ weekly .md ํŒŒ์ผ๋“ค์—์„œ ์‚ฌ์šฉ์ž๊ฐ€ ์ž‘์„ฑํ•œ ๋ถ€๋ถ„๋“ค์„ ๋ฝ‘์•„๋‚ด์„œ ํ•œ ํŒŒ์ผ๋กœ ๋งŒ๋“ค์–ด์ค๋‹ˆ๋‹ค.'''
import glob
import re
import pathlib
def getBasename(path):
'''๊ฒฝ๋กœ์—์„œ ํŒŒ์ผ ์ด๋ฆ„๋งŒ ์ถ”์ถœ. (a/b/c.md์—์„œ c.md๋งŒ ์ถ”์ถœ.)'''
return pathlib.Path(path).name