Skip to content

Instantly share code, notes, and snippets.

@pojntfx
pojntfx / main.sh
Last active March 19, 2024 03:03
Bluesky/AT Protocol: cURL API Interaction Cheatsheet
#!/bin/bash
# This script resolves a DID, retrieves an API key, fetches a user's feed,
# and posts a "Hello, world" message to the user's feed.
# Resolve DID for handle
HANDLE='felicitas.pojtinger.com'
DID_URL="https://bsky.social/xrpc/com.atproto.identity.resolveHandle"
export DID=$(curl -G \
--data-urlencode "handle=$HANDLE" \
@subrezon
subrezon / openwrt-on-proxmox.md
Created February 15, 2023 14:56
How to set up an OpenWRT VM in Proxmox
  1. Go to OpenWRT release page, select the latest release stable release, then targets -> x86 -> 64. Right-click generic-ext4-combined.img.gz (not the "efi"!) and copy the link.

  2. On the Proxmox host, download the archive and unpack it:

wget *paste link here*
gunzip openwrt-*.img.gz
  1. Resize the image to be the size you want your VM's disk to be (example with 8 GiB):
//vrchat_world_loader
//VRChatのワールドを順次キャッシュにロードするuwscスクリプト
//License: CC0
PUBLIC instance_id, check_interval, user_id
//使い方
// 下記のuser_idの「usr_xxx...」の部分に、自分のユーザIDを設定して保存し、
// 保存したスクリプトをUWSC.exeにドラッグ&ドロップして放置する。
// 数分おきにVRCウィンドウがアクティブになり、ワールドが自動でロードされる。
@TheNetJedi
TheNetJedi / ExportLambdaFunctions.sh
Last active November 8, 2023 15:44
Bash script to download all your Lambda functions.
#!/usr/bin/env bash
#You need to have aws-cli installed and configured
#Credits to Reddit user u/aa93 for the suggestions
mkdir code
aws lambda list-functions | \
grep FunctionName | \
cut -d '"' -f4 | \
while read -r name; do
aws lambda get-function --function-name $name | tail -n 3 | egrep -o 'https?://[^ ]+' | sed 's/"//' | xargs wget -O ./code/$name.zip
@uemuraj
uemuraj / kishou-xml.md
Last active November 15, 2021 03:21
気象庁防災情報XMLチュートリアル

気象庁防災情報XMLチュートリアル

気象庁防災情報XMLをご存知でしょうか。天気予報や警報を主に、多種多様な情報が気象庁から公開されています。
現在、ユーザ登録をすれば誰でも無料で受け取ることができます。
2020年8月で運用終了しました。

実際、どんな情報が来るのか簡単に見てみましょう。

@Roadmaster
Roadmaster / google-chrome-lxc.sh
Created October 18, 2017 21:16
Set up an lxc container with google chrome so it runs confined but displays on localhost.
#!/bin/bash
# Set up an lxc container with google chrome so it runs confined but displayed on the
# localhost.
# Adapted from https://blog.simos.info/how-to-run-graphics-accelerated-gui-apps-in-lxd-containers-on-your-ubuntu-desktop/
# Assume setguid/setid for root is properly setup
# root:1000:1
# Assume aptcache profile exists, see https://gist.github.com/Roadmaster/754110f3f49fef19ec89ae29f29edd11
LXC_NAME=chrome-container
@okapies
okapies / mastodon-ostatus.md
Last active September 5, 2021 11:39
Mastodon OStatus API の叩き方

Mastodon が他のインスタンスと情報交換をする OStatus API の使い方。使ってるだけのユーザは知る必要がない裏側の話。

host-meta

Mastodon インスタンスに対して、RFC6415 が規定する /.well-known/host-meta というパスを要求すると以下の XML が返ってくる.

<?xml version="1.0"?>
<XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0">
  <Link rel="lrdd" type="application/xrd+xml" template="https://[MASTODON_HOST]/.well-known/webfinger?resource={uri}"/>
</XRD>
@nunomorgadinho
nunomorgadinho / gist:b2d8e5b8f5fec5b0ed946b24fa288a91
Created February 10, 2017 13:30
PHPCS + WordPress Coding Standards
# Install brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Install composer
brew install homebrew/php/composer
### PHPCS
composer global require "squizlabs/php_codesniffer=*"
# Add to your .bash_profile
@mignonstyle
mignonstyle / markdown-cheatsheet.md
Last active May 9, 2024 12:10
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 引用 先頭に`&gt;`を記述します。ネストは`&gt;`を多重に記述します。 ```
&gt; 引用 &gt; 引用
&gt;&gt; 多重引用
``` &gt; 引用 &gt; 引用
&gt;&gt; 多重引用 ## 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 箇条書きリスト ハイフン`-`、プラス`+`、アスタリスク`*`のいずれかを先頭に記
@yociya
yociya / amazon-history.js
Last active June 24, 2023 23:33
Amazonの注文履歴を年毎に集計して出力します 利用額 / 注文件数 / 最高額(1注文での) 使い方はコメントを参照
var historyUrl = 'https://www.amazon.co.jp/gp/css/order-history?orderFilter=year-$year$&startIndex=$index$';
function beforeSendHook(xhr){
xhr.setRequestHeader('X-Requested-With'
, {
toString: function(){
return '';
}
}
);