Skip to content

Instantly share code, notes, and snippets.

View tushuhei's full-sized avatar

Shuhei Iitsuka tushuhei

View GitHub Profile
function migrateObject(obj) {
const clipPath = obj?.clipPath;
if (clipPath && clipPath.type === 'group' && clipPath.eraser === true) {
clipPath.type = 'eraser';
delete clipPath.eraser;
const rect = clipPath.objects.shift();
obj.clipPath = rect.clipPath;
obj.eraser = clipPath;
}
@kinu
kinu / how_i_got_into_google.md
Last active November 1, 2023 01:08
Google に入るまでの話

Google に入ったときの話 (Kinuko)

祭っぽいので私も書いてみることにした!お手軽に gist で。

コンテキスト:https://togetter.com/li/1331865

対策とか(特になし)

と書き出したはいいが、私が受けたときは本も情報もあまりなく、かつ競プロ的なものの存在も知らなかったので、とりあえず家にあったアルゴリズムの本を2回くらい読み直した。そして受かった。最初っから情報があまりない方のパターンで申し訳ない 😄

@jthomas
jthomas / package.json
Last active September 24, 2023 21:58
Using TensorFlow.js with MobileNet models for image classification on Node.js
{
"name": "tf-js",
"version": "1.0.0",
"main": "script.js",
"license": "MIT",
"dependencies": {
"@tensorflow-models/mobilenet": "^0.2.2",
"@tensorflow/tfjs": "^0.12.3",
"@tensorflow/tfjs-node": "^0.1.9",
"jpeg-js": "^0.3.4"
@anj1
anj1 / subexpr.py
Last active January 20, 2020 22:41
import types
import tensorflow as tf
import numpy as np
# Expressions are represented as lists of lists,
# in lisp style -- the symbol name is the head (first element)
# of the list, and the arguments follow.
# add an expression to an expression list, recursively if necessary.
def add_expr_to_list(exprlist, expr):
@karpathy
karpathy / pg-pong.py
Created May 30, 2016 22:50
Training a Neural Network ATARI Pong agent with Policy Gradients from raw pixels
""" Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """
import numpy as np
import cPickle as pickle
import gym
# hyperparameters
H = 200 # number of hidden layer neurons
batch_size = 10 # every how many episodes to do a param update?
learning_rate = 1e-4
gamma = 0.99 # discount factor for reward
@eevee
eevee / perlin.py
Last active March 2, 2024 08:48
Perlin noise in Python
"""Perlin noise implementation."""
# Licensed under ISC
from itertools import product
import math
import random
def smoothstep(t):
"""Smooth curve with a zero derivative at 0 and 1, making it useful for
interpolating.
@voluntas
voluntas / webrtc.rst
Last active May 14, 2024 10:12
WebRTC コトハジメ
@patriciogonzalezvivo
patriciogonzalezvivo / GLSL-Noise.md
Last active May 16, 2024 21:20
GLSL Noise Algorithms

Please consider using http://lygia.xyz instead of copy/pasting this functions. It expand suport for voronoi, voronoise, fbm, noise, worley, noise, derivatives and much more, through simple file dependencies. Take a look to https://github.com/patriciogonzalezvivo/lygia/tree/main/generative

Generic 1,2,3 Noise

float rand(float n){return fract(sin(n) * 43758.5453123);}

float noise(float p){
	float fl = floor(p);
  float fc = fract(p);