Skip to content

Instantly share code, notes, and snippets.

package main
import (
"fmt"
"log"
"net/http"
)
const requestURL = "https://twitter.com/utgwkk"
@utgwkk
utgwkk / quine.sql
Created May 15, 2021 03:17
Quine in SQL (SQLite3)
with quine as (select 'with quine as (select %c%s%c as s) select printf(s, char(39), s, char(39)) from quine' as s) select printf(s, char(39), s, char(39)) from quine
{
"took" : 26,
"_shards" : {
"successful" : 3,
"total" : 3,
"failed" : 0
},
"timed_out" : false,
"hits" : {
"total" : 330,
令和
平成
昭和
大正
明治
慶応
元治
文久
万延
安政
@utgwkk
utgwkk / keybindings.json
Created May 5, 2020 13:27
VS Code keybindings
// Place your key bindings in this file to override the defaultsauto[]
[
{
"key": "ctrl+q",
"command": "-workbench.action.quickOpenView"
}
]
.Chromeで見ると3行で折り返される {
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
display: -webkit-box;
overflow: hidden;
text-overflow: -o-ellipsis-lastline;
word-wrap: break-word;
}
@utgwkk
utgwkk / detect_useless_if.py
Last active November 8, 2019 03:10
boolをそのまま返せばいいのを検出するやつ
import sys
import ast
class TrueFalseDetected(Exception):
def __init__(self, lineno, col):
self.lineno = lineno
self.col = col
def __str__(self):
return 'Useless `if` detected at line {}, column {}'.format(self.lineno, self.col)
#!/usr/bin/perl
use strict;
use warnings;
=begin comment
各言語実装のディレクトリが置いてあるディレクトリ (ISUCON8予選なら torb/webapp/)にこのスクリプトを置いて実行すると、各言語実装のディレクトリに.gitignoreが配置される
=end comment
=cut
sub get_gitignore {
<!DOCTYPE html>
<meta charset="utf-8">
<title>Twitter Archive Viewer</title>
<script>window.YTD = { tweet: {}, account: {} }</script>
<script src="tweet.js"></script><!-- this is loading a file from the archive -->
<script src="account.js"></script><!-- this is loading a file from the archive -->
<style>
.tweet { border: 1px solid #eee; margin: 8px }
.full_text { padding: 8px }
.created_at { padding: 8px; color: #777 }
@utgwkk
utgwkk / 良さみ.py
Created February 28, 2019 08:57
ありえん良さみが深い
def 優勝():
print("二郎からのセイク")
class 良さみがある:
ありえん = 10
def __init__(self, depth):
self.depth = depth
def ありえん良さみが深い(self):