Skip to content

Instantly share code, notes, and snippets.

View mktakuya's full-sized avatar
🏠
Working from home

Takuya Mukohira mktakuya

🏠
Working from home
View GitHub Profile
@mktakuya
mktakuya / .pythonstartup
Created March 11, 2014 04:45
# -*- coding:utf-8 -*- # Pythonスタートアップ import readline import rlcompleter import atexit import os # タブ補完 readline.parse_and_bind('tab: complete') # ヒストリーファイル histfile = os.path.join(os.environ['HOME'], '.pythonhistory') try: readline.read_history_file(histfile) except IOError: pass atexit.register(readline.write_history_file, histfile) del os, h…
# -*- coding:utf-8 -*-
# Pythonスタートアップ
import readline
import rlcompleter
import atexit
import os
# タブ補完
readline.parse_and_bind('tab: complete')
@mktakuya
mktakuya / omi_return.rb
Created April 29, 2014 12:22
Rubyはreturnを省略できるらしい。こわい。
#!/usr/bin/env ruby
# coding:utf-8
def abs(data)
if data >= 0 then
data
else
data *= -1
end
end
@mktakuya
mktakuya / josho_create_accout.md
Last active August 29, 2015 14:01
新規アカウントの作り方 - 情報処理同好会 新入生向け資料

新規アカウントの作り方 - 情報処理同好会 新入生向け資料

情処の備品のPCを使う人は、PCの中に自分のアカウントを作ってもらいます。

アカウントの作り方

  • PCの電源をつける
  • ログインする(ユーザ名とパスワードは、PCの近くに紙があるのでそれで)
  • 以下のコマンドを実行する
@mktakuya
mktakuya / kaiki.rb
Created November 24, 2014 09:56
怪奇文書生成器
# coding:utf-8
require 'base64'
print "Message?\n--> "
message = STDIN.gets.chomp
code = Base64.encode64(message)
reversed_code = code.reverse
puts reversed_code
@mktakuya
mktakuya / Guardfile
Created January 9, 2015 06:54
レポート自動コンパイルマシン
guard :shell do
watch(/(.*).tex/) do |m|
`echo #{m[1]}`
`platex -interaction=nonstopmode #{m[1]}`
`dvipdfmx #{m[1]}`
`open -g -a Skim #{m[1]}.pdf`
end
end
@mktakuya
mktakuya / install.sh
Created January 26, 2015 09:03
dotfiles自動撒き撒きマシーン
#!/bin/sh
cd $(dirname $0)
for dotfile in .?*
do
if [ $dotfile != '..' ] && [ $dotfile != '.git' ]
then
ln -Fis "$PWD/$dotfile" $HOME
fi
done
@mktakuya
mktakuya / like.rb
Created February 3, 2016 12:01
ActiveRecord::Callbacksのサンプル
class Like < ActiveRecord::Base
after_save :send_email_notification
after_save :send_facebook_notification
def send_mail_notification
# メール送信の処理
end
def send_facebook_notification
# facebook通知の処理
情報処理同好会のみなさま
情報5年の向平です。
最強プレゼンソフト決定戦というイベントを開催したいと思うのでその告知メールです。
最近、PowerPointやKeynoteなどデファクトスタンダードなもの以外のプレゼンソフトを使ったり、さらには自作したりするのが流行っているようです。
Web上で編集・プレゼンできるようになっていたり、Markdownで書けたりなど、いろいろあるようです。
情処でも、プレゼンソフトを自作している人を2、3名くらい観測しています。
#include <stdio.h>
int main(void)
{
int age;
char gender;
printf("[女性と子供の安心車両 乗車判定プログラム]\n");
printf("性別を入力してください(m: 男性, f: 女性)\n");
@mktakuya
mktakuya / .zshrc
Created September 28, 2016 14:03
pyenv settings
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"