Skip to content

Instantly share code, notes, and snippets.

@twinkfrag
twinkfrag / ogp_check.js
Created September 19, 2024 05:37
OGPを軽くチェックするブックマークレット
/*
参考: https://sinap.jp/blog/md5pj5uixdzi
テキスト結合等不要なコードの整理を適用
*/
(function(){
const body = document.querySelector('body');
const metas = document.querySelectorAll('meta');
let og_type, og_title, og_sitename, og_admin, og_locale, og_image, og_url, og_description, h_description;
@twinkfrag
twinkfrag / WindowsTerminal_settings.json
Last active November 8, 2022 02:21
locates in %LocalAppData%\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\RoamingState\settings.json
{
"$help": "https://aka.ms/terminal-documentation",
"$schema": "https://aka.ms/terminal-profiles-schema",
"actions":
[
{
"command":
{
"action": "copy",
"singleLine": false
@twinkfrag
twinkfrag / oauth2_proxy.cfg
Created September 10, 2018 10:26
OAuth2_proxy service with socket
## OAuth2 Proxy Config File
## https://github.com/bitly/oauth2_proxy
## /etc/oauth2_proxy.cfg
http_address = "unix:///run/socket/oauth2_proxy.socket"
upstreams = [ "file:///dev/null" ]
email_domains = [ "*" ]
@twinkfrag
twinkfrag / restrict_apt_upgrade.sh
Created April 10, 2018 08:06
screenの中でしかapt upgradeできないようにする
# write this in /etc/bash.bashrc to cannot "apt upgrade" not in screen
apt() {
if [[ $@ == "upgrade" ]]; then
if [ -n "$STY" ]; then
command apt "$@"
else
echo 'you should apt upgrade in "screen -R"'
fi
else
command apt "$@"
@twinkfrag
twinkfrag / wslrc.sh
Last active September 27, 2024 10:14
cat << EOF >> .bashrc
# ----------------------------
if [ -f ~/.bash.bashrc ]; then
. ~/.bash.bashrc
fi
# ----------------------------
EOF
@twinkfrag
twinkfrag / imys_window.js
Last active January 30, 2018 17:29
あいりすミスティリア!だけのウインドウを作る
/* in about:config
dom.disable_window_open_feature.location = false;
dom.disable_window_open_feature.status = false;
browser.link.open_newwindow.restriction = 1;
*/
// if "location=no" in FireFox, url is in titlebar.
window.open("http://pc-play.games.dmm.com/play/imys/", null, "width=1280,height=720,scrollbars=no,location=yes");
window.open("http://pc-play.games.dmm.co.jp/play/imys_r", null, "width=1280,height=720,scrollbars=no,location=yes");
@twinkfrag
twinkfrag / KeyCode.cs
Created February 25, 2017 04:32
Translate Scancode and VirtualKeyCode each other
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace KeyCode
{
// MapVirtualKey Function
@twinkfrag
twinkfrag / IwiNetPro16ApiClient.cs
Created November 15, 2016 07:01
IwiNetPro16ApiClient
// PM> Install-Package Newtonsoft.Json
// Add Reference to System.Web;
using System;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using System.Web;
using Newtonsoft.Json;
namespace IwiNetPro16ApiClient
@twinkfrag
twinkfrag / Algo15_ex4.java
Created October 15, 2015 04:47
アルゴ演習15-4
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* Created by owner on 2015/10/15.
@twinkfrag
twinkfrag / Algo15_ex3.java
Created October 8, 2015 01:26
アルゴ演習15-3
/**
* Created by @twinkfrag on 2015/09/26.
*/
import java.nio.file.*;
import java.util.*;
import java.io.*;
import java.util.stream.*;
/**