Skip to content

Instantly share code, notes, and snippets.

View shomah4a's full-sized avatar

shoma shomah4a

  • 17:24 (UTC +09:00)
View GitHub Profile
@shomah4a
shomah4a / hoge.el
Last active July 26, 2021 08:23
wsl copy paste from windows clipboard
;; 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)
@shomah4a
shomah4a / hoge.kt
Last active January 15, 2021 01:09
class SomeTest() {
data class Hoge(
@get:Min(10)
val x: Int
)
@Validated
@Component
class Fuga() {
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
import json
import sys
def p(key, indent):
print('%s%s' % (' ' * (indent*2), key))
def print_object(obj, indent=0):
@shomah4a
shomah4a / ssm-login.py
Last active May 4, 2021 02:33
ssm-login.py
#!/usr/bin/env python3
import argparse
import os
import subprocess
import sys
import boto3
@shomah4a
shomah4a / spam.txt
Last active May 1, 2020 02:16
spam
From: James Porter [email protected]
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 February 23, 2017 01:20
神csvをあれするやつ
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 February 7, 2017 02:48
jqみたいなやつ
#!/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]+)\]')
@shomah4a
shomah4a / block.py
Last active November 15, 2016 06:32
#-*- coding:utf-8 -*-
class BlockExit(BaseException):
def __init__(self, block):
self.block = block
class Block(object):
@shomah4a
shomah4a / add_time.py
Last active September 13, 2016 05:34
#-*- coding:utf-8 -*-
from __future__ import print_function
import sys
import datetime
def get_format():