Skip to content

Instantly share code, notes, and snippets.

View creasty's full-sized avatar

Yuki Iwanaga creasty

View GitHub Profile
@Altech
Altech / chatgpt_function.ts
Created October 4, 2023 10:03
chatgpt_function.ts
import { DefineFunction, Schema, SlackFunction } from "deno-slack-sdk/mod.ts";
import { SlackAPIClient } from "deno-slack-sdk/deps.ts";
export const ConfigFunctionDefinition = DefineFunction({
callback_id: "config_function",
title: "Config function",
description: "Operate the configuration of the bot",
source_file: "functions/config_function.ts",
input_parameters: {
properties: {
@pudquick
pudquick / brew.md
Last active April 6, 2024 21:42
Lightly "sandboxed" homebrew on macOS

brew is a bad neighbor

This isn't a guide about locking down homebrew so that it can't touch the rest of your system security-wise.

This guide doesn't fix the inherent security issues of a package management system that will literally yell at you if you try to do something about "huh, maybe it's not great my executables are writeable by my account without requiring authorization first".

But it absolutely is a guide about shoving it into its own little corner so that you can take it or leave it as you see fit, instead of just letting the project do what it likes like completely taking over permissions and ownership of a directory that might be in use by other software on your Mac and stomping all over their contents.

By following this guide you will:

  • Never have to run sudo to forcefully change permissions of some directory to be owned by your account
@Tynael
Tynael / README.md
Last active January 22, 2024 01:06
How to use npx to run gist based scripts
CREATE TEMP FUNCTION parseMessage(messageB64 BYTES)
RETURNS STRING
LANGUAGE js AS """
const toSextet = (ch) => {
if (0x41 <= ch && ch < 0x41 + 26) {
return ch - 0x41;
} else if (0x61 <= ch && ch < 0x71 + 26) {
return ch - (0x61 - 26);
} else if (0x30 <= ch && ch < 0x30 + 10) {
return ch + (52 - 0x30);
@ngtk
ngtk / talking_points_when_visiting_companies.md
Last active June 20, 2021 06:29
話を聞きに行くときに訊くこと

話を聞きに行くときに訊くこと

働き方

  • 勤務時間は決まっていますか?
  • メンバーの平均勤務時間帯は何時から何時ですか?
  • リモートは可能ですか?
  • 具体的にどのようなケースでリモートをしていますか?

開発環境

  • 使用するPCは選べる?Macは許容される?アプリケーションは自由に入れられる?
@creasty
creasty / Slack theme
Last active February 28, 2023 08:16
#1a1a1a,#444444,#8397a9,#39444d,#303030,#a8a8a8,#a3a46f,#af7070
@wjmazza
wjmazza / google-sheets-colour-preview.js
Last active April 19, 2024 06:15 — forked from Pathoschild/google-sheets-color-preview.js
A Google Sheets script which adds colour preview to cells. When you edit a cell containing a valid CSS hexadecimal colour code (like #000 or #000000), the background colour will be changed to that colour and the font colour will be changed to the inverse colour for readability.
/*
This script is meant to be used with a Google Sheets spreadsheet. When you edit a cell containing a
valid CSS hexadecimal colour code (like #000 or #000000), the background colour will be changed to
that colour and the font colour will be changed to the inverse colour for readability.
To use this script in a Google Sheets spreadsheet:
1. go to Tools » Script Editor » Spreadsheet;
2. erase everything in the text editor;
3. change the title to "Set colour preview on edit";
@qnighy
qnighy / gf256.py
Created June 14, 2016 13:01
GF(256) = GF(2^8) = GF(2)[x]/(x^8 + x^4 + x^3 + x + 1)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
class GF256(object):
""" GF(256), defined as GF(2)[x]/(x^8 + x^4 + x^3 + x + 1).
"""
def __init__(self, byteval):
byteval = int(byteval)
@patriciogonzalezvivo
patriciogonzalezvivo / GLSL-Noise.md
Last active May 5, 2024 09:04
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);