Skip to content

Instantly share code, notes, and snippets.

View iwatakeshi's full-sized avatar
📚
Always learning

Takeshi iwatakeshi

📚
Always learning
View GitHub Profile
#!/bin/bash
# Check if the input file is provided
if [ -z "$1" ]; then
echo "Usage: $0 <path-to-temp-file>"
exit 1
fi
# The input file containing the file content (e.g., the temp-file extracted from git show)
temp_file="$1"
@iwatakeshi
iwatakeshi / aaa.ts
Created February 10, 2025 15:42 — forked from xorus/aaa.ts
graphql yoga in Hono server
import {Env, Hono, HonoRequest} from "hono";
import {createSchema, createYoga} from "graphql-yoga";
const schema = createSchema({
typeDefs: `...graphql schema...`,
resolvers: {
Query: {
hello: () => 'Hello wolrd :)',
},
Subscription: {
@iwatakeshi
iwatakeshi / schema.ts
Created January 29, 2025 21:48 — forked from gyopiazza/schema.ts
Multi-tenant with Drizzle ORM (multiple sqlite databases) - PoC
import { integer, sqliteTableCreator, text } from 'drizzle-orm/sqlite-core'
const sqliteTable = (tenant?: string) =>
sqliteTableCreator(name => (tenant ? `${tenant}_${name}` : name))
export const users = sqliteTable()('users', {
id: integer('id', { mode: 'number' }).primaryKey({ autoIncrement: true }),
name: text('name'),
})
@iwatakeshi
iwatakeshi / Ruby with chruby
Created October 20, 2023 14:40 — forked from rubyandcoffee/Ruby with chruby
chruby - Installing and managing Ruby versions
To install chruby and ruby-install:
brew install chruby ruby-install
To install Ruby using ruby-install:
ruby-install ruby 2.7.1
NOTE: You can find latest stable version of Ruby here: https://www.ruby-lang.org/en/downloads/
If you have issues installing Ruby then try the following:
brew install openssl@3
ruby-install 3.2.2 -- --with-openssl-dir=$(brew --prefix openssl@3)
@iwatakeshi
iwatakeshi / tilix_ubuntu_guide.md
Created March 7, 2023 20:21 — forked from agtbaskara/tilix_ubuntu_guide.md
Installation Guide for Tilix on Ubuntu

Install Tilix on Ubuntu 20.04

Install Tilix

sudo apt-get install tilix

Fix Tilix VTE

sudo ln -s /etc/profile.d/vte-2.91.sh /etc/profile.d/vte.sh
sudo chmod +x /etc/profile.d/vte.sh
@iwatakeshi
iwatakeshi / py_setup_popos.sh
Last active April 14, 2023 15:21
Setup Python on Pop_OS!
#!/bin/bash
# 1. Install python3 (if applicable)
if ! command -v python3 &> /dev/null; then
sudo apt update
sudo apt install python3
fi
# 2. Install pip (if applicable)
if ! command -v pip &> /dev/null; then
@iwatakeshi
iwatakeshi / $.ts
Created February 27, 2023 02:55 — forked from lawrencecchen/$.ts
next-auth with remix
// app/routes/api/auth/$.ts
import NextAuth from "~/lib/next-auth/index.server";
export const { action, loader } = NextAuth({
providers: [
GoogleProvider({
clientId: env.GOOGLE_CLIENT_ID,
clientSecret: env.GOOGLE_CLIENT_SECRET,
}),
],
@iwatakeshi
iwatakeshi / raspberry_fast_capture.py
Created October 10, 2022 20:22 — forked from CarlosGS/raspberry_fast_capture.py
Fast reading from the raspberry camera with Python, Numpy, and OpenCV. See the comments for more details.
# Fast reading from the raspberry camera with Python, Numpy, and OpenCV
# Allows to process grayscale video up to 124 FPS (tested in Raspberry Zero Wifi with V2.1 camera)
#
# Made by @CarlosGS in May 2017
# Club de Robotica - Universidad Autonoma de Madrid
# http://crm.ii.uam.es/
# License: Public Domain, attribution appreciated
import cv2
import numpy as np
@iwatakeshi
iwatakeshi / rename.ps1
Created January 1, 2022 04:04
Recursively rename files using PowerShell within a folder
Get-ChildItem *.tsx,*.js,*.css,*.ts -Recurse | Rename-Item -newname { $_.Name + ".txt" }
@iwatakeshi
iwatakeshi / google_login.ts
Created August 14, 2021 02:10 — forked from Brandawg93/google_login.ts
Login to Google Account via Puppeteer
import puppeteer from 'puppeteer-extra';
import pluginStealth from 'puppeteer-extra-plugin-stealth'; // Use v2.4.5 instead of latest
import * as readline from 'readline';
puppeteer.use(pluginStealth());
// Use '-h' arg for headful login.
const headless = !process.argv.includes('-h');
// Prompt user for email and password.