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
# encoding: utf-8 | |
require "find" | |
require 'json' | |
jsons = [] | |
Dir.foreach(Dir.pwd) do |dir| | |
real_path = File.expand_path dir | |
unless real_path == Dir.pwd | |
if File.exist?(real_path + '/package-metadata.json') |
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.util.ArrayList; | |
import java.util.HashMap; | |
import java.util.List; | |
import java.util.Map; | |
public class Paginate { | |
private static final int DEFALUT_SHOW_PAGE_COUNT = 5; | |
public static List<Map<String, String>> paginate(String pageSizeStr, String pageCdStr) { | |
int pageSize = Integer.valueOf(pageSizeStr); |
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
# encoding: utf-8 | |
require 'rubygems' | |
configs = { | |
'envs' => | |
{'RUBY_HOME' => 'ruby_home_path', 'JRUBY_HOME' => 'jruby_home_path', 'JAVA_HOME' => 'java_home_path'}, | |
'add_path_env' => | |
{'RUBY_HOME' => 'bin', 'JRUBY_HOME' => 'bin', 'JAVA_HOME' => 'bin'} | |
} |
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
#!/bin/bash | |
sudo apt-get update -y | |
sudo apt-get upgrade -y | |
sudo apt-get install python-software-properties -y | |
# add git | |
sudo apt-add-repository ppa:git-core/ppa -y | |
# add nodejs |
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
#!/bin/sh | |
tee -a Gemfile << EOF | |
gem 'bootstrap-sass', '~> 3.1.1' | |
gem 'settingslogic' | |
gem 'simple_form' | |
gem 'slim-rails' | |
group :development do |
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
# encoding: utf-8 | |
require 'openssl' | |
require 'base64' | |
require 'sequel' | |
DB = Sequel.connect('sqlite://cardinfo.sqlite3') | |
class CardInfo < Sequel::Model | |
plugin :schema |
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
#encoding: utf-8 | |
class ShuangSeQiu | |
def initialize | |
@times = ARGV && ARGV[0] ? ARGV[0].to_i : 5 | |
end | |
def create | |
@times.times do |time| | |
reds = [] |
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
#encoding: utf-8 | |
require 'find' | |
class CreateGetterSetterMethodsForJava | |
def initialize | |
@work_path = File.dirname(File.expand_path(__FILE__)) | |
if ARGV.length != 0 | |
if File.file?(ARGV[0]) |
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
# add this code in config/environments/development.rb | |
Rails::Rack::Logger.class_eval do | |
def call_with_quiet_assets(env) | |
previous_level = Rails.logger.level | |
Rails.logger.level = Logger::ERROR if env['PATH_INFO'].index("/assets/") == 0 | |
call_without_quiet_assets(env).tap do | |
Rails.logger.level = previous_level | |
end | |
end |