This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """PreToolUse hook: block write-method `gh api` calls. | |
| Allows GET-only `gh api` invocations to pass through to the normal permission | |
| check. Blocks any invocation that uses: | |
| - -X / --method with a non-read method (POST/PUT/PATCH/DELETE), | |
| including attached short form like -XPOST | |
| - -f / -F / --field / --raw-field (gh implicitly POSTs when these are set), | |
| including attached short form like -ftitle=foo | |
| - --input (reads body from file, implies POST) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| CMYKテストパターン生成スクリプト | |
| - output_no_profile.jpg : ICCプロファイルなし(Twitterが誤変換するやつ) | |
| - output_with_profile.jpg: ICCプロファイルあり(正しく変換された場合) | |
| """ | |
| from PIL import Image, ImageDraw, ImageFont | |
| import struct | |
| W, H = 800, 1000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| javascript:(function () { | |
| const aid = 'tydja'; | |
| const sb_base_uri = 'https://scrapbox.io/my-dlsite-lib/'; | |
| const titleEl = document.getElementById('work_name'); | |
| const idMatch = document.URL.match(/([A-Z]{2}\d+)\.html$/); | |
| if (!titleEl || !idMatch) { | |
| alert('情報の抽出に失敗した。'); | |
| return; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def size = 400 | |
| def shake(base:, width:) | |
| base + width / 2 - rand(width) | |
| end | |
| foots = 6.times.map { } | |
| def setup | |
| createCanvas(size, size) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # frozen_string_literal: true | |
| source 'https://rubygems.org' | |
| # gem "rails" | |
| gem 'rubocop', '=1.67.0' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| javascript:(function () { | |
| var map = document.getElementById('map'); | |
| map.width = 1800; // 特に意味のある値ではない。小さいとガビるので、適当にこれぐらい。元々のmapはサイズの指定のないimgなので適当に画面幅とかになっている? | |
| var c = document.createElement('canvas'); | |
| c.width = map.width; | |
| c.height = map.height; | |
| var ctx = c.getContext('2d'); | |
| ctx.drawImage(map, 0, 0); | |
| map.src = c.toDataURL(); | |
| })(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if ENV['MACKEREL_AGENT_PLUGIN_META'] == '1' | |
| require 'json' | |
| meta = { | |
| :graphs => { | |
| 'dns.querytime' => { | |
| :label => 'time', | |
| :unit => 'integer', | |
| :metrics => [ | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "flag" | |
| "fmt" | |
| "strconv" | |
| ) | |
| type myVar struct { | |
| V int64 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <array> | |
| #include <numbers> | |
| #include <cmath> | |
| int const N = 10; | |
| int prev(int n) { | |
| return (N + n - 1) % N; | |
| } | |
| double const dt = 0.0001; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| HOST_ID='xxx' | |
| API_KEY='xxx' | |
| OUTS=`sudo get-co2` | |
| CO2=`echo ${OUTS} | jq ".co2"` | |
| TEMP=`echo ${OUTS} | jq ".temperature"` | |
| TT=`echo ${OUTS} | jq ".TT"` | |
| TIME=`date +%s` | |
| JSON=$(cat << EOS | |
| [ | |
| { |
NewerOlder