Skip to content

Instantly share code, notes, and snippets.

View foloinfo's full-sized avatar
🏖️
Happy coding

foloinfo foloinfo

🏖️
Happy coding
View GitHub Profile
@foloinfo
foloinfo / generate_migration.sh
Created October 19, 2023 05:42
Prisma rollback shell script
#!/bin/bash
# prisma does not generate rollback (down script by default)
# this script will generate the down script for each migration
name=$1
dir=$(pwd)
if [ -z "$name" ]
then
@foloinfo
foloinfo / eas-build.yml
Created September 27, 2023 01:42
eas build on github actions example (.github/workflows/eas-build.yml)
name: Build App
on:
workflow_dispatch:
inputs:
os:
type: choice
description: OS to build on. Ubuntu is faster, MacOS supports iOS builds, Windows is unsupported
options:
- macos-12
- ubuntu-latest
@foloinfo
foloinfo / .zshrc
Last active January 17, 2023 23:35
OpenAI cli client script with streaming output
export OPENAI_API_KEY=sk-xxxxxxx # your API key
ask(){
ask_openai $1 | openai_parse_stream -
echo ''
}
ask_openai(){
curl -N \
-H "Accept: text/event-stream" \
-H "Content-Type: application/json" \
@foloinfo
foloinfo / eth_encrypt.ts
Created January 2, 2023 23:30
Deno compatible encryption with x25519-xsalsa20-poly1305 for Metamask (using eth_getEncryptionPublicKey and eth_decrypt)
import * as nacl from 'https://raw.githubusercontent.com/intob/tweetnacl-deno/master/src/nacl.ts'
export function hex(arrayBuffer)
{
return Array.prototype.map.call(
new Uint8Array(arrayBuffer),
n => n.toString(16).padStart(2, "0")
).join("");
}
@foloinfo
foloinfo / exchangeRate.js
Last active November 29, 2022 11:37
Google spreadsheet function (app script) to fetch crypto exchange rate using coin api with cache
// 1. get your coin api key, free key is limited to 100 req/day
// 2. add AppScript on google spreadsheet
// 3. save & call function `exchangeRate("BTC")` to get the current exchange rate
// refer to the previous gist for function withou cache.
const cacheHours = 6
const cacheMsecs = cacheHours * 60 * 60 * 1000
function exchangeRate(ticker) {
const cache = PropertiesService.getScriptProperties()
@foloinfo
foloinfo / config.yml
Last active September 28, 2023 17:54
eas ios build with circle CI setup
version: 2.1
executors:
docker-node:
working_directory: ~/your_app
docker:
- image: cimg/node:16.17.1
mac:
working_directory: ~/your_app
macos:
xcode: 14.0.0
@foloinfo
foloinfo / instruction.md
Last active July 8, 2022 06:43
Imgly video / photo editor SDK android localization setup with Expo development build.
  1. Make a custom plugin file
// withTranslation.js
const { AndroidConfig, withStringsXml } = require('@expo/config-plugins')

const withTranslation = (expoConfig) => {
  return withStringsXml(expoConfig, (modConfig) => {
    modConfig.modResults = AndroidConfig.Strings.setStringItem(
 [
@foloinfo
foloinfo / Localizable.strings
Created March 10, 2022 05:23
Imgly PhotoEditorSDK Localizable.strings
<?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>pesdk_adjustments_accessibility_blacksIntensitySliderLabel</key>
<string>Blacks intensity</string>
<key>pesdk_adjustments_accessibility_brightnessIntensitySliderLabel</key>
<string>Brightness intensity</string>
<key>pesdk_adjustments_accessibility_clarityIntensitySliderLabel</key>
<string>Clarity intensity</string>

foloinfo(以下、「当社」といいます。)は、当社の提供するDeed(以下、「本サービス」といいます。)において、収集及び利用する当社サービスのご利用者の個人情報(以下、「個人情報」といいます。)を、個人情報の保護に関する法律及び本プライバシーポリシーに従い適切に管理するよう努めます。

個人情報の利用目的

当社は、本サービス及び関連する各種サービス業務を遂行するに伴い、業務遂行上必要となる個人情報を収集し、下記各号の目的で利用させていただきます。

  1. 本サービスに関する本人確認等、本サービスの提供、維持、保護及び改善のため
  2. 本サービスに関するご案内、お問い合わせ等への対応のため
  3. 本サービスに関する規約等の変更などを通知するため
  4. 本サービスの維持・不具合対応・改善や新サービスの開発等に役立てるため
  5. 登録ユーザーの反社会的勢力の該当性を判断するため
  6. 上記の利用目的に付随する目的のため
@foloinfo
foloinfo / firacode.css
Last active March 26, 2021 03:20
firacode.css
@font-face{
font-family: 'Fira Code';
src: url('https://raw.githubusercontent.com/tonsky/FiraCode/master/distr/eot/FiraCode-Regular.eot') format('embedded-opentype'),
url('https://raw.githubusercontent.com/tonsky/FiraCode/master/distr/woff2/FiraCode-Regular.woff2') format('woff2'),
url('https://raw.githubusercontent.com/tonsky/FiraCode/master/distr/woff/FiraCode-Regular.woff') format('woff'),
url('https://raw.githubusercontent.com/tonsky/FiraCode/master/distr/ttf/FiraCode-Regular.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}