Skip to content

Instantly share code, notes, and snippets.

View mohemohe's full-sized avatar
🍣
さーもん

mohemohe mohemohe

🍣
さーもん
View GitHub Profile
@mohemohe
mohemohe / full_conoha_mode.css
Last active May 14, 2017 15:35
このはもーど
@-moz-document url-prefix("https://manage.conoha.jp/") {
.header,
.side {
background: rgba(255, 255, 255, 0.4) !important;
}
.header *,
.side * {
background: transparent !important;
}
@mohemohe
mohemohe / FetchWithTimeout.ts
Created March 10, 2017 08:07
fetchAPIにタイムアウトがないのでawaitしたときに死ぬからつらい
new Promise(async(resolve, reject) => {
let timeoutHendle = setTimeout(() => {
reject();
}, 5000);
let response: Response = null;
if (init == null) {
response = await fetch(input);
} else {
response = await fetch(input, init);
using System;
namespace MoheMohe
{
public class PasswordHelper
{
public static string ReadFromStdIn()
{
var password = new System.Text.StringBuilder();
new Action(() =>
{
#!/bin/zsh
cat ~/.ssh/conf.d/*/*.sshconf >! ~/.ssh/config
grep -ioE 'Host[nN]ame (.*.local)' ~/.ssh/config | uniq | sed 's/\(Host[nN]ame\) \(.*\)/\2/g' | sort | uniq | while read domain
do
check=`arp $domain 2> /dev/null`
if [[ $? = 0 ]]; then
ip=`echo $check | sed 's/.*(\([0-9]*\.[0-9]*\.[0-9]*\.[0-9]*\)).*/\1/'`
regex='s/\(Host[nN]ame\) \('$domain'\)/\1 '$ip'/g'
@mohemohe
mohemohe / KenkovFuck.es6
Created December 4, 2016 15:54
KenkovFuck 簡易インタプリター
/**
* KenkovFuckインタプリターの実装クラス
*/
export default class KenkovFuck {
/**
* もろもろの初期化を行う
*
* @param {string} [src=] ソースコード(ファイルではなく文字列)
*
* @public
" .vimrcから移植
" 同時編集に優しい設定
set fenc=utf-8
set nobackup
set noswapfile
set autoread
" 行番号表示
set number
#
# Executes commands at the start of an interactive session.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
echo initializing zsh...
# Source Prezto.
@mohemohe
mohemohe / index.php
Created September 25, 2016 14:45
うおおおおおおおおおおおおああああああああああああああああああああああああああああああ!!!!!!!!!!!! (ブリブリブリブリュリュリュリュリュリュ!!!!!!ブツチチブブブチチチ
<?php
mb_internal_encoding('UTF-8');
$butimiri = 'うおおおおおおおおおおおおあああああああああああああああああああああああああああああああ!!!!!!!!!!! (ブリブリブリブリュリュリュリュリュリュ!!!!!!ブツチチブブブチチチチブリリイリブブブブゥゥゥゥッッッ!!!!!!!)';
$arg = urldecode(htmlspecialchars($_SERVER['REQUEST_URI']));
$target = mb_substr(mb_strstr($arg, '?'), 1, mb_strlen($arg) - 1);
if(!empty($target)) {
$reply = '@'.$target;
$reply = mb_ereg_replace('\\+', ' ', $reply);
@mohemohe
mohemohe / format.py
Created August 15, 2016 18:31
Raspberry Piでリモコン信号を記憶する補助スクリプト
#!/usr/bin/env python
# coding: utf-8
import signal
import sys
signal.signal(signal.SIGINT, signal.SIG_IGN)
buff = sys.stdin.read().splitlines()
buff.pop(0)
@mohemohe
mohemohe / letsencrypt.sh
Created July 22, 2016 21:59
proxy_passしててcertのrenewが面倒くさい系のletsencrypt
#!/usr/bin/zsh
#### 設定 ここから ################################################################################
# letsencrypt クライアント
client="/usr/bin/certbot"
# そのままrenewできる(静的|動的)サイト
sites1=(
# domain,/path/to/basedir