Skip to content

Instantly share code, notes, and snippets.

@shomah4a
shomah4a / hoge.el
Last active Jul 26, 2021
wsl copy paste from windows clipboard
View hoge.el
;; for wsl
(defun wsl-copy (start end)
(interactive "r")
(shell-command-on-region start end "clip.exe"))
(defun wsl-paste ()
(interactive "*")
(shell-command "powershell.exe -Command 'Get-Clipboard -Format Text' | sed s/\r//g" 1))
(advice-add 'clipboard-kill-ring-save :before #'wsl-copy)
(advice-add 'clipboard-kill-region :before #'wsl-copy)
View hoge.kt
class SomeTest() {
data class Hoge(
@get:Min(10)
val x: Int
)
@Validated
@Component
class Fuga() {
View fxtest.kt
import arrow.core.Either
import arrow.core.extensions.fx
import arrow.core.flatMap
import java.lang.IllegalStateException
class Hello {
companion object {
@JvmStatic
fun main(args: Array<String>) {
val count = 100000
View print_keys.py
import json
import sys
def p(key, indent):
print('%s%s' % (' ' * (indent*2), key))
def print_object(obj, indent=0):
View ssm-login.py
#!/usr/bin/env python3
import argparse
import os
import subprocess
import sys
import boto3
View spam.txt
From: James Porter james@j-tech.dev
My name is James from J-Tech.dev. I am a specialist recruiter for software engineering. I speak Japanese and English and can write a little bit of code. Our goal is to tell you about the newest tech companies in Tokyo.
Global Fintech Company - Fastest Growing Engineering Team in Japan
Global team spread across North America and Asia
Office is located inside of a WeWork office
Very competitive salaries
Startup atmosphere
Modern tech stack
@shomah4a
shomah4a / kami2normal.py
Last active Feb 23, 2017
神csvをあれするやつ
View kami2normal.py
import codecs
import csv
import sys
def main():
with codecs.open('syukujitsu.csv', encoding='sjis') as fp:
reader = csv.reader(fp)
contents = list(reader)[2:-2]
@shomah4a
shomah4a / jq.py
Last active Feb 7, 2017
jqみたいなやつ
View jq.py
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
import json
import operator
import re
import sys
ATTR_REG = re.compile(r'\.([a-zA-Z_][a-zA-Z0-9_]*)')
INDEX_REG = re.compile(r'\[(-?[0-9]+)\]')
View block.py
#-*- coding:utf-8 -*-
class BlockExit(BaseException):
def __init__(self, block):
self.block = block
class Block(object):
View add_time.py
#-*- coding:utf-8 -*-
from __future__ import print_function
import sys
import datetime
def get_format():