Skip to content

Instantly share code, notes, and snippets.

@co2meal
co2meal / csv_to_yaml.rb
Created January 31, 2013 08:44
csv_to_yaml.rb
# Use example 2
# Go to translation sheet 3
# File -> Publish to the web... -> Get a link to the published data -> Choose CSV, Choose the sheet 4
# Copy the link and Download the CSV file. 5
# $ ruby script/csv_to_yaml.rb < tmp/CookiTranslationSheet.csv 6
7
require 'csv' 8
require 'yaml' 9
require 'active_support/core_ext/hash/deep_merge' 10
11
@co2meal
co2meal / coin.rb
Created December 1, 2012 07:03
Solution of coin combination issue by nicola
class Coin
def initialize(amount)
@amount = amount
@memo = {}
end
COINS = [50, 100, 500, 1000, 5000, 10000]
MAXIMUM = 100000000000
def count
calc(COINS.count-1, @amount)
#include <cstdio>
#include <cmath>
#include <typeinfo>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
/**************************************************************
Problem: 1758
User: co2meal
Language: C++
Result: Accepted
Time:7740 ms
Memory:70164 kb
****************************************************************/
#include <iostream>
@co2meal
co2meal / test.md
Created October 16, 2012 09:55
adsfasfd

asdasd

@co2meal
co2meal / Default (Windows).sublime-keymap
Created October 13, 2012 10:00
Sublime Mac OS version key binding for windows.
/*
On OS X, basic text manipulations (left, right, command+left, etc) make use of the system key bindings,
and don't need to be repeated here. Anything listed here will take precedence, however.
*/
[
{ "keys": ["alt+shift+n"], "command": "new_window" },
{ "keys": ["alt+shift+w"], "command": "close_window" },
{ "keys": ["alt+o"], "command": "prompt_open" },
{ "keys": ["alt+shift+t"], "command": "reopen_last_file" },
{ "keys": ["alt+super+up"], "command": "switch_file", "args": {"extensions": ["cpp", "cxx", "cc", "c", "hpp", "hxx", "h", "ipp", "inl", "m", "mm"]} },
@co2meal
co2meal / gist:3706261
Created September 12, 2012 12:20 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@co2meal
co2meal / date_time.coffee
Created September 6, 2012 07:22 — forked from markbates/date_time.coffee
Example: Rails-style date/time helpers in CoffeeScript
Number::seconds = ->
@ * 1000
Number::minutes = ->
@seconds() * 60
Number::minute = Number::minutes
Number::hours = ->
@minutes() * 60
= link_to "view modal", "/", :remote => true, :id => "modal-link"
coffee:
$("#modal-link").handle_modal()
  • 왕좌의 게임 : 기본 내용외 항구에 전함이 있다면 파워 토큰 1개를 얻는다.
  • 아군 바다길은 행군과 퇴각 때만 이용함(유닛이 전함인 경우 퇴각할 때만 이용)
  • 가문카드 효과 발생 우선순위는 턴 순서로 적용 한다.
  • 사상자 처리 : 가문카드의 칼아이콘 수만큼 패한 유저의 해당지역 유닛을 파괴. 탑아이콘 수 만큼 승리한 상대 플레이어의 칼아이콘의 영향을 무효화
  • 공성병기가 퇴각시 파괴한다.
  • 퇴각한 유닛은 전투력이 없으며 눕혀놓고 다시 전투를 참가할 수없다/ 이런 유닛이 다시 퇴각을 할 경우 파괴한다.
  • 주둔군 토큰이 있는 방어자가 패하면 토큰은 완전 제거된다.