Skip to content

Instantly share code, notes, and snippets.

View pistatium's full-sized avatar
🚲
Cycling

kimihiro_n pistatium

🚲
Cycling
View GitHub Profile
@arikfr
arikfr / refresh.py
Last active May 3, 2024 10:33
Redash Refresh API usage example with parameters Raw
import os
import requests
import time
from pprint import pprint
def poll_job(s, redash_url, job):
# TODO: add timeout
while job['status'] not in (3,4):
response = s.get('{}/api/jobs/{}'.format(redash_url, job['id']))
@okapies
okapies / mastodon-client.md
Last active October 3, 2023 10:18
Mastodon API の叩き方

Mastodon の API を叩くには以下の手順を踏む必要がある:

  1. OAuth2 クライアントを登録する
  2. アクセストークンを取得する
  3. アクセストークンを Authorization ヘッダに指定して API にアクセスする

OAuth2 クライアント登録

Mastodon の Apps API に登録情報を送ってクライアントを払い出してもらう(一度だけやれば OK).

@Mark24Code
Mark24Code / app.py
Created February 16, 2017 12:16 — forked from zaccrites/app.py
Flask Application Factory
import jinja2
from flask import Flask, render_template, request, redirect, url_for
from flask.ext.sqlalchemy import SQLAlchemy
from . import formatting
from .config import get_config
db = SQLAlchemy()
@joncardasis
joncardasis / WebServer.py
Created February 7, 2017 21:08
A simple and quick HTTP web server in Python
"""
Author: Jonathan Cardasis
"""
import socket
import signal # Allow socket destruction on Ctrl+C
import sys
import time
import threading
@okunokentaro
okunokentaro / recipe.js
Last active January 30, 2024 08:38
Rxチャーハン
import {Observable, Subject} from 'rxjs'
// # 材料
// ## ご飯
class ご飯 {
freeze() {
this.温度 = -10
return this
}
@jbn
jbn / aiohttp_uptime_http_server.py
Created April 7, 2016 12:24
An example showing how to stream HTML in a aiohttp server.
import asyncio
from aiohttp import web
import subprocess
async def uptime_handler(request):
# http://HOST:PORT/?interval=90
interval = int(request.GET.get('interval', 1))
# Without the Content-Type, most (all?) browsers will not render
@hugochinchilla
hugochinchilla / slack_munin.sh
Last active July 7, 2023 14:53 — forked from anarchivist/slack_munin.sh
Slack notification script for Munin
#!/bin/bash
# Slack notification script for Munin
# Mark Matienzo (@anarchivist)
#
# To use:
# 1) Create a new incoming webhook for Slack
# 2) Edit the configuration variables that start with "SLACK_" below
# 3) Add the following to your munin configuration:
#
@MakoTano
MakoTano / cli_template.go
Last active May 18, 2019 12:32
github.com/codegangsta/cli を使ったコマンドラインツールのテンプレート
package main
import (
"fmt"
"os"
"github.com/codegangsta/cli"
)
func main() {
#!/bin/sh
root=`dirname $0`/..
secret_dir=$root/.secret
suffix='.enc'
for target in $(find $secret_dir -name "*$suffix" ! -name ".*" -type f); do
file=$(echo $target | sed -e "s/.enc$//")
if [ -e $file ]; then
echo "Skip $file"
continue
@voluntas
voluntas / mqtt.rst
Last active March 1, 2023 06:47
MQTT とはなんだったのか

MQTT とはなんだったのか

更新

2017-05-09

作者

@voluntas

バージョン

3.14

URL

http://voluntas.github.io/

MQTT をググって調べた人向け