This file contains 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
# DS-Lite修正 | |
# 参考 | |
# https://techlog.iij.ad.jp/contents/dslite-raspi | |
REMOTE='' | |
# SLAAC シングルの人は多分これでいける | |
# LOCAL=`ip addr show br0 | grep 'mngtmpaddr' | awk '{print $2}' | awk -F/ '{print $1}'` | |
# DHCP-PDv6の人はこっち | |
LOCAL=`ip addr show br0 | grep 'inet6' | grep 'dynamic' | awk '{print $2}' | awk -F/ '{print $1}'` |
This file contains 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
# app/decorators/character_decorator.rb | |
# for https://github.com/kyubuns/misterioso/commit/3598eec678cf7368e105141b1cd7b8c259f1af12 | |
module CharacterDecorator | |
EQUIPMENT_COLOR_TABLE = { | |
1 => 'black', | |
2 => 'orange', | |
3 => 'forestgreenq', | |
4 => 'blue', |
This file contains 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
! NEC Portable Internetwork Core Operating System Software | |
! IX Series IX2010 (magellan-sec) Software, Version 8.3.47, RELEASE SOFTWARE | |
! Compiled Aug 27-Fri-2010 10:36:11 JST #1 | |
! Last updated Dec 23-Mon-2013 15:57:03 JST | |
! | |
! | |
hostname sanjose | |
timezone +09 00 | |
! | |
! |
This file contains 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
<?php | |
class A { | |
public function getA() { | |
return "A"; | |
} | |
} | |
function getA() { | |
return "A"; |
This file contains 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
require 'flickraw' | |
require 'open-uri' | |
require 'exifr' | |
class ConnectionAdapter | |
def connection | |
FlickRaw.api_key = "" | |
FlickRaw.shared_secret = "" | |
flickr.access_token = "" | |
flickr.access_secret = "" |
This file contains 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
MAP_MIN = 0 | |
MAP_MAX = 3000 | |
BLOCK_SIZE = 10 | |
DEBUG = false | |
# [level1_rate, level2_rate, ...] | |
RATE = [ | |
25, | |
20, | |
15, | |
11, |
This file contains 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
@near_blocks = [] | |
@cost = nil | |
def nears(i,j) | |
[[i-1,j],[i+1,j],[i,j-1],[i,j+1]] | |
end | |
def near_astar map_sizes, ignores, target, current | |
x = current[:x] | |
y = current[:y] |
This file contains 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 UserHighScore < ActiveRecord::Base | |
belongs_to :user | |
belongs_to :high_score_partition | |
attr_accessible :score | |
after_save do | |
partition = HighScorePartition.where("(min < ? AND ? > max)", self.score, self.score).first("LOCK IN SHARE MODE") | |
# Not partition if cheet? | |
raise "Score not range partition" unless partition | |
# Not modify | |
return true partition.id == self.high_score_partition.id |
This file contains 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 MaterialPermissionHandler < ApplicationPermissionHandler | |
CODE_NAMES = [ | |
:show, :update, :delete, :edit | |
] | |
def has_perm? user, code_name, object_id | |
obj = Material.find_by_id object_id | |
# Accept author. | |
return true if user == obj.user | |
case code_name |
This file contains 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
user_name = "miio" | |
remote_addr = "git@github.com:miio/grit_test.git" | |
clone_args = {quiet: false, verbose: true, progress: true, branch: 'master'} | |
# Open Repository | |
central = create_or_open './storage/central/miio/grit_test/', remote_addr, clone_args | |
working = create_or_open './storage/working/miio/grit_test/', './storage/central/miio/grit_test/', clone_args | |
# Add Remote Branch | |
begin |
NewerOlder