Skip to content

Instantly share code, notes, and snippets.

View 2020-07-01.json
[
{
"id": "00001274",
"kind": "LOCAL",
"entry_number": 419,
"name": "おがじろう",
"country": "東京都",
"biko": "小笠原村観光局",
"image_url": "https://www.yurugp.jp/img/uploads/character/200/00001274.jpg",
"rank": 67,
View search.js
import { useMemo } from "react"
import { useStaticQuery } from "gatsby"
export const useSearch = (searching) => {
const { allMarkdownRemark } = useStaticQuery(graphql`
query {
allMarkdownRemark(
sort: { order: DESC, fields: [frontmatter___date] },
) {
edges {
View wakeonlan.ps1
$ErrorActionPreference = "Stop"
$macAddresses = @($Args | ForEach-Object { $_.Replace(":", "-") })
$header = [byte[]](@(0xFF) * 6)
foreach ($macAddress in $macAddresses) {
$payload = [byte[]]($macAddress.split("-") | ForEach-Object { [Convert]::ToInt32($_, 16) })
$magicPacket = $header + $payload * 16
$client = New-Object System.Net.Sockets.UdpClient
View font-face-for-windows.user.css
/* ==UserStyle==
@name font-face for Windows
@namespace https://gist.github.com/mono0x
@version 0.0.1
@license MIT
==/UserStyle== */
@font-face {
font-family: "MS Pゴシック";
src: local("Meiryo"), local("メイリオ"), local("MS Pゴシック");
}
View font-face-for-macos.user.css
/* ==UserStyle==
@name font-face for macOS
@namespace https://gist.github.com/mono0x
@version 0.0.1
@license MIT
==/UserStyle== */
@font-face {
font-family: "MS PGothic";
src: local("Hiragino Kaku Gothic ProN");
}
View tweetdeck.user.css
/* ==UserStyle==
@name My TweetDeck
@namespace https://gist.github.com/mono0x
@version 0.0.1
@license MIT
==/UserStyle== */
@-moz-document domain("tweetdeck.twitter.com") {
.column:first-child {
width: 400px;
}
View share_on_twitter.js
javascript:(function(){var w=550,h=420;window.open("https://twitter.com/intent/tweet?text="+encodeURIComponent(document.title)+"&url="+encodeURIComponent(location.href),"_blank","width="+w+",height="+h+",left="+(window.innerWidth-w)/2+",top="+(window.innerHeight-h)/2+",scrollbars=yes,resizable=yes,toolbar=no,location=yes")})()
@mono0x
mono0x / concat.cmd
Created Apr 16, 2018
Concat movie files using ffmpeg (for Windows)
View concat.cmd
@echo off
setlocal EnableExtensions
:genuniq
set "tmpfile=%tmp%\bat~%RANDOM%.txt"
if exist "%tmpfile%" goto :genuniq
set "output=%~dpn1_combined%~x1"
:loop
View cryptorand_test.go
package test
import (
"crypto/rand"
"encoding/binary"
"testing"
"unsafe"
)
func BenchmarkCryptoRandRead(b *testing.B) {
View event_websites.rb
require 'json'
require 'set'
require 'uri'
events = open('lib/data/sanrio_events_calendar.json') {|f| JSON.parse(f.read) }
uris = events['items'].map {|item|
URI.extract(item['description'], [ 'http', 'https' ])
}.flatten.to_set