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
import java.io.File; | |
import java.io.IOException; | |
import com.fasterxml.jackson.databind.JsonNode; | |
import com.fasterxml.jackson.databind.ObjectMapper; | |
public class Jackson { | |
public static void main(String[] args) { | |
try { | |
ObjectMapper mapper = new ObjectMapper(); |
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
import java.io.File; | |
import java.util.List; | |
import com.fasterxml.jackson.annotation.JsonCreator; | |
import com.fasterxml.jackson.annotation.JsonProperty; | |
import com.fasterxml.jackson.core.type.TypeReference; | |
import com.fasterxml.jackson.databind.ObjectMapper; | |
public class Books { | |
public static void main(String[] args) throws Exception { |
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
package isbn; | |
import java.util.regex.Pattern; | |
/** | |
* ISBN class. | |
*/ | |
public class Isbn { | |
/** Number of digits in ISBN. */ | |
public static final int LENGTH = 13; |
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
(source gnu) | |
(source melpa) | |
(depends-on "redo+") | |
(depends-on "migemo") | |
(depends-on "auto-complete") | |
(depends-on "yasnippet") | |
(depends-on "helm") |
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
#!/usr/bin/env ruby | |
# coding: utf-8 | |
# The MIT License (MIT) | |
# Copyright (c) 2015 Kohei Yamamoto | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights |
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
module HookMethod | |
def hook_method(hook, *methods) | |
methods.each do |method| | |
orig = "#{method}_without_logging".to_sym | |
if instance_methods.include?(orig) | |
raise NameError, "#{orig} isn't a unique name" | |
end | |
alias_method orig, method |
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 Walker | |
Position = Struct.new(:x, :y) | |
MAP = [['a', 'b', 'c', 'd'], ['e', 'f', 'g', 'h'], ['i', 'j', 'k', 'l'], ['m', 'n', 'o', 'p']] | |
def initialize(tiles) | |
@current = Position.new(1, 0) | |
@previous = nil | |
@from = nil | |
@tiles = tiles.split('/').map { |l| l.split('') } | |
end |
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
include_recipe 'selinux::disabled' | |
package 'epel-release' | |
package 'gcc' | |
package 'gcc-c++' | |
package 'git' | |
package 'libyaml-devel' | |
package 'nginx' | |
package 'openssl-devel' | |
package 'postgresql-contrib' |
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
def my_permutation(sequence, r = nil) | |
r = sequence.size if r.nil? || sequence.size < r | |
result = [] | |
enumerate(sequence, r, [], result) | |
result | |
end | |
def enumerate(sequence, r, one_enumeration, result) | |
if one_enumeration.size == r | |
result << one_enumeration.dup |
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
curl の気持ちになって gist を POST |
OlderNewer