Skip to content

Instantly share code, notes, and snippets.

View AtsushiSakai's full-sized avatar
:octocat:

Atsushi Sakai AtsushiSakai

:octocat:
View GitHub Profile
@AtsushiSakai
AtsushiSakai / bitlyapi.py
Last active December 3, 2022 06:08
Get shorten url via bitly v4 API with Python
#
# Get access_token from: https://app.bitly.com/settings/api/
# Then, just call this function with your long url and access token
#
# Ref
# - https://dev.bitly.com/api-reference/#createBitlink
# - https://dev.bitly.com/docs/getting-started/introduction/
import requests
@ritchieking
ritchieking / sqlcsv.sh
Created June 21, 2022 18:06
Wrapper for using SQLite on CSV files
sqlcsv() {
if [ $# -lt 2 ]
then
echo "USAGE: sqlcsv [filename.csv] [SQL]"
echo "In the SQL, refer to the data sourse as [filename]"
else
filename="$1"
dataname=${filename%????}
sqlite3 :memory: -cmd '.mode csv' -cmd ".import $filename $dataname" -cmd '.mode markdown' $2
fi
@giner
giner / fix_ibus-mozc.sh
Last active April 8, 2023 08:04
JAPANESE: Make ibus-mozc remember last used mode
# Make ibus-mozc remember the last used mode (e.g. hiragana) and not switch back to Alphabet on restart
# See https://github.com/google/mozc/issues/381
cd $(mktemp -d)
apt source ibus-mozc
cd mozc-*/
patch src/unix/ibus/property_handler.cc << 'EOF'
--- src/unix/ibus/property_handler.cc.orig 2020-10-28 17:21:18.000849932 +0900
+++ src/unix/ibus/property_handler.cc 2020-10-28 17:21:34.172696046 +0900
@@ -80,7 +80,7 @@
@tangjeff0
tangjeff0 / random_notion.py
Last active July 9, 2023 17:01
get random notion notes to resurface your old ideas!
'''
author:
@tangjeff0
https://www.notion.so/tangjeff0/Public-Home-0e2636bd409b454ea64079ad8213491f
inspired by: https://praxis.fortelabs.co/p-a-r-a-iii-building-an-idea-generator-400347ef3bb6/
with help from: https://medium.com/@jamiealexandre/introducing-notion-py-an-unofficial-python-api-wrapper-for-notion-so-603700f92369
credits:
@jamiealexandre
@lotz84
lotz84 / Main.hs
Last active December 26, 2019 07:35
"Fast and Accurate Least-Mean-Squares Solvers" in Haskell https://arxiv.org/abs/1906.04705
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE NoStarIsType #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# OPTIONS_GHC -fplugin GHC.TypeLits.KnownNat.Solver #-}
{-# OPTIONS_GHC -fplugin GHC.TypeLits.Normalise #-}
@rhoboro
rhoboro / async_sample.py
Last active April 30, 2023 07:24
asyncio, aiohttpを利用した並列処理のサンプルコード
import asyncio
import aiohttp
import async_timeout
from aiohttp import ClientError
async def _fetch(session, url, coro):
"""HTTPリソースからデータを取得しコルーチンを呼び出す
@zchee
zchee / actionlist.vim
Last active April 19, 2024 13:22
IdeaVim actionlist
--- Actions ---
$Copy <M-C>
$Cut <M-X> <S-Del>
$Delete <Del> <BS> <M-BS>
$LRU
$Paste <M-V>
$Redo <M-S-Z> <A-S-BS>
$SearchWeb <A-S-G>
$SelectAll <M-A>
$Undo <M-Z>
@tune
tune / gist:3911829
Created October 18, 2012 13:34
C/C++言語 開発環境

Windows/Linuxで両方で動作する成果物を想定。 有償のツールは理解が得られる方が稀なので除外。

仕様書

外部仕様

Word/Excelが手軽だけど差分が追いにくい。 Markdown+PandocかSphinxでPDF提出がいいかな?