This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# this script will setup dotfiles in repository to your home directory. | |
# please fix dotfiles_path before running this script (if needed). | |
HOME_PATH=~ | |
DOTFILES_PATH=~/archives/dotfiles | |
mkdir ${HOME_PATH}/.old_dotfiles | |
for file in bashrc zshrc screenrc set_proxy elisp emacs.el |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
#include<math.h> | |
typedef struct { | |
double x; | |
double y; | |
} position; | |
void print_position(position pos){ | |
printf("(%.1lf, %.1lf)\n", pos.x, pos.y); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/ruby | |
def area_circle(circle) | |
circle.radius ** 2 * Math::PI | |
end | |
def dist_pos(pos1, pos2) | |
diffx = pos1.x - pos2.x | |
diffy = pos1.y - pos2.y | |
Math::sqrt(diffx ** 2 + diffy ** 2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/ruby | |
class Position | |
def initialize(x, y) | |
@x = x | |
@y = y | |
end | |
def x | |
@x |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
#include<stdlib.h> | |
/* human class (structure) | |
This structure has pointers to methods. | |
*/ | |
typedef struct _human{ | |
char* _name; | |
int _age; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# -*- coding: utf-8 -*- | |
def walk(hash, start, goal, level) | |
cur = start | |
level.times do |i| | |
now = { cur, hash[cur] } | |
puts "#{i+1}/#{level}: #{now.inspect}" | |
cur = hash[cur] | |
return false unless cur | |
return true if cur == goal and (i+1) == level |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 変だったところをちょっと直しました | |
#include<stdio.h> | |
#include<stdlib.h> | |
int main(void) // main関数の宣言が変だった | |
{ | |
char *name[10]; | |
char *buff; | |
int i; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/ruby | |
# generate hitode png | |
# 2009.01.05 | |
# this script needs pureimage | |
# http://cappuccino.jp/keisuken/ | |
require 'optparse' | |
require 'pureimage' | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plugin 'group' | |
configatron.plugins.group.groups.update({ | |
:rits => %w( hitode909 coconutsfine TXT_inaka y_tsuda hightwitter hakobe ytetsuwo epee_noir con_mame opopo isano | |
hirayasu_is hayato240 ritsgirl ken1nakata2 higtwitter yano moji1021 hayato240 shirokurostone tall_zelkova aibou | |
viton masa138 unagi1022 DrunkenTomato ymzkey imcat0514 _udonchan udonchan_ naruto5071 unagi1022 itoga | |
)}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Human | |
def initialize(name) | |
@name = name | |
end | |
def define_method(name, &block) | |
self.class.class_eval do | |
define_method(name, block) | |
end | |
end | |
end |