Skip to content

Instantly share code, notes, and snippets.

View hujuu's full-sized avatar
🌊
big wave

hujuu hujuu

🌊
big wave
  • Tokyo
  • 19:10 (UTC +09:00)
  • X @hujuu
View GitHub Profile
@inorganik
inorganik / app.js
Last active May 12, 2024 13:01
Using CountUp.js in React
import { useEffect, useRef } from 'react'
// playground: https://stackblitz.com/edit/react-ts-nv5fxe?file=App.tsx
export default function App() {
// create a ref and declare an instance for each countUp animation
const countupRef = useRef(null);
let countUpAnim;
@mala
mala / meety_vuln.md
Last active December 18, 2023 05:36
Meety脆弱性 2022-11

Meety脆弱性 2022-11

文責 mala

経緯:

  • Meety退会しようと思ったがアカウントがなかったので、退会するためにアカウントを作ることにした。

免責:

  • 気になった範囲ですぐに見つかったもののうち、悪用可能なものを記載しています。
  • 好ましくないが仕様だろうというものは書いていません。
@hujuu
hujuu / qr_gen_from_csv.py
Created July 12, 2022 23:00
CSV形式の改行文字列からQRコードを生成してPNG形式で保存します
import qrcode
from csv import reader
with open('***.csv', 'r') as csv_file:
csv_reader = reader(csv_file)
list_of_rows = list(csv_reader)
for row in list_of_rows:
# QRコード化したい文字列
QR_STR = row[0]
@hujuu
hujuu / downloadImages.gs
Created July 11, 2022 11:49
Googleスプレッドシートの画像URLを一括保存
/**
* A列に入力された画像URLリストを元に画像をダウンロードしてGoogle Driveに保存
*/
function downloadImages() {
// 作っておいた画像フォルダの情報を取得
var folders = DriveApp.getFoldersByName("画像フォルダ");
if(false === folders.hasNext()) {
return;
}
var folder = folders.next();
select
TABLE_CATALOG AS DB_NAME,
TABLE_SCHEMA AS SCHEMA_NAME,
TABLE_NAME AS TABLE_NAME,
COLUMN_NAME AS COLUMN_NAME,
COLUMN_DEFAULT AS DEFAULT_VALUE,
IS_NULLABLE AS IS_NULLABLE,
CASE WHEN DATA_TYPE in (
'VARCHAR', 'CHAR', ' CHARACTER', 'STRING',
'TEXT'
function long_press(el,nf,lf,sec){
let longclick = false;
let longtap = false;
let touch = false;
let timer;
el.addEventListener('touchstart',()=>{
touch = true;
longtap = false;
timer = setTimeout(() => {
longtap = true;
@nevrending
nevrending / pyjwt.md
Last active January 25, 2023 11:54
JWT Authentication in Python

Notice

Originally did this research during my work for Bitwyre. I'm now open-sourcing this and hope this helps anyone who finds it, please let me know by commenting if this did help you!

JWT on Python

The access_token produced by Auth Server (a token grant OAuth2.0) is actually a JWT token itself, but is using a different length and algorithm than your typical JWT.

It is using RS256 rather that the common HS256 algo.

@mignonstyle
mignonstyle / markdown-cheatsheet.md
Last active June 14, 2024 04:30
Markdown記法 チートシート

Block Elements ## Headers 見出し 先頭に#をレベルの数だけ記述します。 ```

見出し1

見出し2

見出し3

見出し4

見出し5
見出し6
## 見出し2
### 見出し3
#### 見出し4
##### 見出し5
###### 見出し6 ## Block 段落 空白行を挟むことで段落となります。 ```
段落1
(空行)
段落2
``` 段落1 段落2 ## Br 改行 改行の前に半角スペース` `を2つ記述します。 ```
hoge
fuga(スペース2つ)
piyo
``` hoge
fuga piyo ## Blockquotes 引用 先頭に`>`を記述します。ネストは`>`を多重に記述します。 ```
> 引用 > 引用
>> 多重引用
``` > 引用 > 引用
>> 多重引用 ## Code コード `` `バッククオート` `` 3つ、あるいはダッシュ`~`3つで囲みます。 ```
print 'hoge'
``` ```
print 'hoge'
``` ### インラインコード `` `バッククオート` `` で単語を囲むとインラインコードになります。 ```
これは `インラインコード`です。
``` これは `インラインコード`です。 ## pre 整形済みテキスト 半角スペース4個もしくはタブで、コードブロックをpre表示できます ``` class Hoge def hoge print 'hoge' end end
``` class Hoge def hoge print 'hoge' end end ## Hr 水平線 アンダースコア`_` 、アスタリスク`*`、ハイフン`-`などを3つ以上連続して記述します。 ```
hoge
***
hoge
___
hoge
---
``` hoge
***
hoge
___
hoge
--- # Lists ## Ul 箇条書きリスト ハイフン`-`、プラス`+`、アスタリスク`*`のいずれかを先頭に記
@kyohei-shimada
kyohei-shimada / capybara_memo.md
Last active February 12, 2023 23:49
Capybaraを使う上で気をつけること

Capybaraを使う上で気をつけること

アンチパターンとか,ハマりどころとか

expect(page).to have_content 'hogheoge'

expect(page).to have_content 'hogehoge'
@LarryUllman
LarryUllman / gist:fbe8db2f1ecc6c92e74a
Created July 23, 2014 14:49
Stripe - Calculate Subscription Proration
proration cost = (period end - API request time) / (period end - period start) * quantity * plan price