Skip to content

Instantly share code, notes, and snippets.

View sugarshin's full-sized avatar
🏕️
I may be slow to respond.

Shingo Sato sugarshin

🏕️
I may be slow to respond.
View GitHub Profile
@chenchun
chenchun / clone-all-gists.sh
Last active March 3, 2026 14:03
clone all gists and better search them with your own tools #github #gists
#! /bin/bash
set -x
set -e
# generate your token from https://github.com/settings/tokens and save it into gist-token.txt
token=$(cat gist-token.txt)
function cloneOrPull() {
page=$1
curl -L \
-H "Accept: application/vnd.github+json" \
@adtac
adtac / Dockerfile
Last active December 26, 2025 00:20
#!/usr/bin/env docker run
#!/usr/bin/env -S bash -c "docker run -p 8080:8080 -it --rm \$(docker build --progress plain -f \$0 . 2>&1 | tee /dev/stderr | grep -oP 'sha256:[0-9a-f]*')"
# syntax = docker/dockerfile:1.4.0
FROM node:20
WORKDIR /root
RUN npm install sqlite3
@ZPascal
ZPascal / hoge.rb
Last active June 28, 2025 21:50 — forked from minamijoyo/hoge.rb
Using GitHubPrivateRepositoryReleaseDownloadStrategy removed in brew v2
require "formula"
require_relative "lib/private_strategy"
class Hoge < Formula
homepage "https://github.com/yourcompany/hoge"
url "https://github.com/yourcompany/hoge/releases/download/v0.1.0/hoge_v0.1.0_darwin_amd64.tar.gz", :using => GitHubPrivateRepositoryReleaseDownloadStrategy
sha256 "6de411ff3e4b1658a413dd6181fcXXXXXXXXXXXXXXXXXXXX"
head "https://github.com/yourcompany/hoge.git"
version "0.1.0"
@s875515
s875515 / rollupReadEnvFile.js
Last active July 2, 2021 02:14
Because of the "rollup-plugin-dotenv" isn't being update all that much, so I use "@rollup/replace" and "dotenv" in conjunction.
const replace = require('@rollup/plugin-replace');
const envKeys = () => {
const envRaw = require('dotenv').config().parsed || {};
return Object.keys(envRaw).reduce(
(envValues, envValue) => ({ ...envValues, [`process.env.${envValue}`]: JSON.stringify(envRaw[envValue]) }),
{}
);
};
@fukuiretu
fukuiretu / index.d.ts
Last active November 27, 2021 15:57
Nuxt.jsで必要なTypeScriptの型定義
import Vue from 'vue'
import { Route } from 'vue-router'
import { Store } from 'vuex'
import { MetaInfo } from 'vue-meta'
import { AxiosInstance } from 'axios'
interface NuxtContext {
isClient: boolean
isServer: boolean
isStatic: boolean
@xola139
xola139 / Invalid Host Header NGROK
Created February 19, 2018 19:17
When Invalid Host Header when ngrok tries to connect to Angular or React dev server
When Invalid Host Header when ngrok tries to connect to Angular or React dev server use this form for run ngrok.
ngrok http 8080 -host-header="localhost:8080"
ngrok http --host-header=rewrite 8080
@kawabata
kawabata / criminal_jc.md
Last active June 28, 2022 07:04 — forked from shunirr/criminal_jc.md
女子中学生チケット詐欺事件

criminal_jc

@Mikulas
Mikulas / config.yaml
Created August 18, 2017 14:19
frp kubernetes config
apiVersion: v1
kind: Namespace
metadata:
name: frp
---
apiVersion: v1
kind: LimitRange
metadata:
@webframp
webframp / keybase.md
Created July 25, 2017 18:14
Signing git commits on github using keybase.io gpg key

Probably one of the easiest things you'll ever do with gpg

Install Keybase: https://keybase.io/download and Ensure the keybase cli is in your PATH

First get the public key

keybase pgp export | gpg --import

Next get the private key

@embarq
embarq / errors.ts
Created June 3, 2017 02:06
Custom errors in TypeScript
import ExpressValidator = require('express-validator');
export class HttpError extends Error {
constructor(public code: number, message: string) {
super(message);
Object.setPrototypeOf(this, HttpError.prototype);
}
}
export class RequestValidationError extends Error {