Skip to content

Instantly share code, notes, and snippets.

View hotohoto's full-sized avatar
🐢
daily small stepping

Hoyeong-GenGenAI hotohoto

🐢
daily small stepping
  • GenGenAI
  • Seoul, Korea
View GitHub Profile
@hotohoto
hotohoto / window.py
Created December 15, 2020 06:43
Window a time series dataset with pandas
import pandas as pd
import numpy as np
input_csv = "./weather_history_tiny.csv"
output_csv = "./weather_history_tiny_windowed.csv"
df = pd.read_csv(input_csv)
n_lags = 1
N = len(df)
all_columns = df.columns
@hotohoto
hotohoto / example.py
Created October 7, 2020 04:45
Python stack dumper
import signal
import threading
import traceback
import time
import sys
def func2():
y = 2
time.sleep(1)
@hotohoto
hotohoto / script.md
Created November 24, 2018 05:26
script to remove vertical tabs (linebreak in a paragraph) in google docs

(Tentative)

function removeVerticalTabs() {
  var body = DocumentApp.getActiveDocument().getBody();
  var bodyText = body.getText();
  bodyText = bodyText.replace( /\r/g, "\n" );
  body.setText( bodyText );
}
@hotohoto
hotohoto / http.py
Last active August 7, 2018 07:19
Run simple http server using python
import http.server
import socketserver
socketserver.TCPServer(("", 1234), http.server.SimpleHTTPRequestHandler).serve_forever()
@hotohoto
hotohoto / example.sh
Created July 19, 2018 04:30
Storage management with volumes in linux
# list
fdisk -l
pvs
pvdisplay
vgs
vgdisplay
lvs
lvdisplay
# create
@hotohoto
hotohoto / python3_venv.md
Last active August 30, 2017 09:00
Setting up python3 virtual environment

Somehow Install python3. (I'm not sure. Needs to be updated later. This is for macOS.)

brew install python3

Install venv module first to create virtual environment.

pip3 install venv

Make initial virtual environment files.

@hotohoto
hotohoto / nodejs_systemctl.md
Created August 23, 2017 05:27
Run Node.js web server via systemctl

Make a configuration file like below at /etc/systemd/system/nodejs_www.service.

[Unit]
Description=My Node.js Web Server

[Service]
ExecStart=/usr/bin/yarn start

WorkingDirectory=/home/hotohoto/app
@hotohoto
hotohoto / iterm2colorset.itermcolors
Created August 7, 2017 09:47
atom like iterm2 colorset
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.0</real>
@hotohoto
hotohoto / nvidia_graphics_card_on_linux.md
Created February 14, 2017 21:42
nvidia graphics card on linux
@hotohoto
hotohoto / simple_nodejs.md
Last active July 26, 2017 02:27
Make a simple nodejs project base with babel-preset-latest
yarn init
yarn add babel-cli babel-preset-latest
vi index.js
"scripts": {
 "start": "babel-node --debug --presets latest -- index.js "