Skip to content

Instantly share code, notes, and snippets.

View jyuch's full-sized avatar

jyuch jyuch

View GitHub Profile
@jyuch
jyuch / rails.py
Created November 9, 2013 09:06
http://qiita.com/Nabetani/items/0ddde0164a745cd09c34 の問題をクソみたいなコードで実装したもの。
teleport = {
0: {1: 3, 3: 1, 2: 4, 4: 2},
1: {2: 3, 3: 2, 1: 4, 4: 1},
2: {1: 2, 2: 1, 3: 4, 4: 3}}
def search_route(tiles):
prev_pos = 2
current_pos = 2
route = []
translate = {1: "A", 2: "B", 3: "C", 4: "D", 5: "E", 6: "F", 7: "G", 8: "H", 9: "I"}
@jyuch
jyuch / exists.py
Created July 28, 2014 15:23
IronPythonオンリーイベント
# -*- coding: utf-8 -*-
import clr
import sys
from os import path, stat
from datetime import date
from System import Console, ConsoleColor
@jyuch
jyuch / jyuch_kana.py
Last active August 29, 2015 14:13
Pythonでもオレオレ文字コードを実装したい
""" 'Jyuch-Kana' Codec
Written by jyuch (http://jyuch.hatenablog.com/)
"""
import codecs
from itertools import count
def encode(input, errors='strict'):
@jyuch
jyuch / hexdump.py
Created January 13, 2015 11:50
16進数で出力します
# -*- coding: utf-8 -*-
import sys
import os.path
import io
from binascii import hexlify
from itertools import count
def main(argv):
if len(argv) == 1:
@jyuch
jyuch / MainClass.cs
Last active March 16, 2016 13:21
別のソフトウェアをホストして異常終了したらJenkinsに通知しようとしたもの
using System;
using System.Diagnostics;
using System.Text;
using System.Xml;
using System.Xml.Linq;
using System.Net.Http;
using System.Net;
using System.IO;
namespace Watchdoc
Module Module1
Sub Main()
Dim f = New Fixed()
Dim d = New Delimiter()
Dim fa = f.GetType().GetCustomAttributes(GetType(BaseRecordAttribute), True)
For Each it As BaseRecordAttribute In fa
Console.WriteLine(it.GetType().FullName)
@jyuch
jyuch / Dockerfile
Last active September 4, 2016 12:47
DockerでAZ-Prolog環境をブチ上げるアレ
FROM ubuntu:14.04
RUN set -x \
&& apt-get update \
&& apt-get install -y build-essential libncursesw5-dev wget \
&& rm -rf /var/lib/apt/lists/*
RUN wget https://www.az-prolog.com/?ddownload=52585 -O /tmp/azprolog9.24-ubuntu14.04x64.tgz
RUN set -x \
@jyuch
jyuch / Dockerfile
Last active September 29, 2016 14:26
Dockerでpsqlをサクッとブチ上げるアレ
FROM ubuntu:16.04
RUN set -x \
&& apt-get update \
&& apt-get install -y postgresql-client \
&& rm -rf /var/lib/apt/lists/*
@jyuch
jyuch / Dockerfile
Created October 2, 2016 09:21
Dockerでio環境をブチ上げるアレ
FROM ubuntu:16.04
RUN set -x \
&& apt-get update \
&& apt-get install -y wget unzip emacs \
&& rm -rf /var/lib/apt/lists/*
RUN set -x \
&& cd tmp \
&& wget http://iobin.suspended-chord.info/linux/iobin-linux-x64-deb-current.zip \
@jyuch
jyuch / docker-compose.yml
Last active January 2, 2020 14:53
DockerでElastiFlowをブチ上げるアレ
#------------------------------------------------------------------------------
# Portions of this file are Copyright (C)2019 Robert Cowart
#
# Portions of this file are subject to the Robert Cowart Public License (the
# "License") and may not be used or distributed except in compliance with the
# License. You may obtain a copy of the License at:
#
# http://www.koiossian.com/public/robert_cowart_public_license.txt
#
# Software distributed under the License is distributed on an "AS IS" basis,