Routes file (routes.rb
):
resources :data_loaders do
collection do
delete 'multiple_destroy'
end
end
The controller:
# file: mongoid.yml | |
default: | |
sessions: | |
production: | |
database: foobar | |
hosts: | |
- localhost:27017 | |
# file: mongoid.rb |
Write the file q1.txt: | |
query= | |
<!DOCTYPE Query> | |
<Query client="true" processor="TSV" limit="100" header="1"> | |
<Dataset name="hsapiens_snp" config="snp_1_config"> | |
<Filter name="chr_name" value="22"/> | |
<Filter name="chrom_start" value="1"/> | |
<Filter name="chrom_end" value="80000000"/> | |
<Attribute name="refsnp_id"/> |
Routes file (routes.rb
):
resources :data_loaders do
collection do
delete 'multiple_destroy'
end
end
The controller:
require 'net/http' | |
def download_net_http(uris, thread_count) | |
queue = Queue.new | |
uris.map { |uri| queue << uri } | |
threads = thread_count.times.map do | |
Thread.new do | |
while !queue.empty? && uri = queue.pop |
class Fixnum | |
def autoref? | |
a = to_s.rjust(10, "0").split("").map(&:to_i) # a = [2,3,1,1,3,4,5,5,1,9] | |
h = Hash[(0..9).map{|e| [e, 0]}] | |
a.each{|e| h[e]+=1} | |
a.each_with_index do |n, i| | |
return false if n!=h[i] | |
end | |
true | |
end |
require 'rubygems/package' | |
def tar_gz_squeeze(dirname, filename: nil) | |
filename = filename || dirname | |
File.open("#{filename}.tar.gz", "wb") do |file| | |
Zlib::GzipWriter.wrap(file) do |gz| | |
Gem::Package::TarWriter.new(gz) do |tar| | |
Dir.glob("#{dirname}/*.json").each do |f| | |
puts "adding #{File.basename(f)}..." |
clone: | |
path: github.com/gogits/gogs | |
build: | |
image: golang:$$GO_VERSION | |
environment: | |
- TAGS="pam sqlite" | |
- BUILD_OS="windows linux darwin freebsd openbsd netbsd" |
<!DOCTYPE html> | |
<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ --> | |
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]--> | |
<!--[if IE 7]> <html class="no-js ie7 oldie" lang="en"> <![endif]--> | |
<!--[if IE 8]> <html class="no-js ie8 oldie" lang="en"> <![endif]--> | |
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]--> | |
<head> | |
<meta charset='utf-8'> | |