Skip to content

Instantly share code, notes, and snippets.

View jaekookang's full-sized avatar
🎯
Focusing

jkang jaekookang

🎯
Focusing
View GitHub Profile
@Eversmile12
Eversmile12 / Blockchain.py
Created January 28, 2022 10:51
Python Blockchain
# Python program to create Blockchain
# For timestamp
import datetime
# Calculating the hash
# in order to add digital
# fingerprints to the blocks
import hashlib
@idleberg
idleberg / vscode-macos-context-menu.md
Last active October 8, 2024 16:05
“Open in Visual Studio Code” in macOS context-menu

Open in Visual Studio Code

  • Open Automator
  • Create a new document
  • Select Quick Action
  • Set “Service receives selected” to files or folders in any application
  • Add a Run Shell Script action
    • your default shell should already be selected, otherwise use /bin/zsh for macOS 10.15 (”Catalina”) or later
    • older versions of macOS use /bin/bash
  • if you're using something else, you probably know what to do 😉
@tiglek
tiglek / install-nanum-fonts-on-ubuntu.md
Last active August 15, 2023 08:56
Ubuntu 한글 글꼴 설치
@vadimkantorov
vadimkantorov / perlin.py
Last active February 15, 2024 10:36
Perlin noise in PyTorch
# ported from https://github.com/pvigier/perlin-numpy/blob/master/perlin2d.py
import torch
import math
def rand_perlin_2d(shape, res, fade = lambda t: 6*t**5 - 15*t**4 + 10*t**3):
delta = (res[0] / shape[0], res[1] / shape[1])
d = (shape[0] // res[0], shape[1] // res[1])
grid = torch.stack(torch.meshgrid(torch.arange(0, res[0], delta[0]), torch.arange(0, res[1], delta[1])), dim = -1) % 1
@bradtraversy
bradtraversy / mysql_cheat_sheet.md
Last active October 11, 2024 13:02
MySQL Cheat Sheet

MySQL Cheat Sheet

Help with SQL commands to interact with a MySQL database

MySQL Locations

  • Mac /usr/local/mysql/bin
  • Windows /Program Files/MySQL/MySQL version/bin
  • Xampp /xampp/mysql/bin

Add mysql to your PATH

@cshjin
cshjin / matfac.m
Last active September 27, 2019 02:23
Matrix factorization problem implemented in Tensorflow and Matlab (with yalmip)
yalmip('clear')
T = [0 1 0 1; 1 0 1 0; 0 1 0 1; 1 0 1 0];
x = sdpvar(4, 1);
y = sdpvar(4, 1);
assign(x, randn(4, 1));
assign(y, randn(4, 1));
const = [x'*x <= 1; y'*y <=1];
% const = [];
@ServerlessBot
ServerlessBot / IAMCredentials.json
Last active December 20, 2023 16:50
Minimum credential set for Serverless Framework
{
"Statement": [
{
"Action": [
"apigateway:*",
"cloudformation:CancelUpdateStack",
"cloudformation:ContinueUpdateRollback",
"cloudformation:CreateChangeSet",
"cloudformation:CreateStack",
"cloudformation:CreateUploadBucket",
# This example shows how to use keras TensorBoard callback
# with model.train_on_batch
import tensorflow.keras as keras
# Setup the model
model = keras.models.Sequential()
model.add(...) # Add your layers
model.compile(...) # Compile as usual
def tf_pca(x):
'''
Compute PCA on the bottom two dimensions of x,
eg assuming dims = [..., observations, features]
'''
# Center
x -= tf.reduce_mean(x, -2, keepdims=True)
# Currently, the GPU implementation of SVD is awful.
# It is slower than moving data back to CPU to SVD there
@kmundnic
kmundnic / krippendorff_alpha.m
Last active May 9, 2019 15:24
Krippendorff's alpha in MATLAB
function alpha=kriAlpha(data,scale)
% alpha=kriAlpha(data,scale)
% calculates Krippendorff's Alpha as a measure of inter-rater agreement
% data: rate matrix, each row is a rater or coder, each column is a case
% scale: level of measurement, supported are 'nominal', 'ordinal', 'interval'
% missing values have to be coded as NaN or inf
% For details about Krippendorff's Alpha see:
% http://en.wikipedia.org/wiki/Krippendorff%27s_Alpha
% Hayes, Andrew F. & Krippendorff, Klaus (2007). Answering the call for a