Who? needs some information to be able to index news:
- news title
- creation date in country timezone
- URL to original article page
There are some optional information that could be benefecial for
#!/usr/bin/env erb | |
<% | |
stats = `bundle --local | tail -n2 | head -n1`.scan(/[0-9]+/) | |
def files_for(ext) | |
Dir.glob('**/*.' + ext) | |
end | |
def size_for(ext) | |
files_for(ext).map{|f| File.size(f) }.inject(:+).to_i | |
end |
(setq quick-command "pwd") | |
(defun set-quick-command () | |
"Set quick command" | |
(interactive) | |
(setq quick-command (read-string "Enter a quick commmand:"))) | |
(defun execute-quick-command () | |
"Execute a command that was set in quick-command variable" | |
(interactive) |
#!/usr/bin/env ruby | |
# coding: utf-8 | |
def header(s) | |
s = "⦿ #{s}" | |
puts | |
puts s | |
puts '=' * s.size | |
end |
require 'uri' | |
require 'net/http' | |
require 'pp' | |
require 'json' | |
seat_number = 427_300 # write start seat number | |
count = 10 | |
(seat_number..seat_number + count).each do |seat| | |
url = URI('http://natega.youm7.com/Home/GetResultStage1/') |
#!/usr/bin/env ruby | |
# usage : graph file | |
# usage : cat file | graph | |
# file lines are casted to float so it has to start with a number | |
MAX_LENGTH = 80 | |
BAR_CHAR = '|'.freeze | |
data = ARGV.empty? ? STDIN.read.lines : File.read(ARGV.first).lines |
#!/usr/bin/env bash | |
for f in `git ls-files | grep "\..*keep"`; do | |
echo -n $f | |
git ls-files `dirname $f` | wc -l | |
done |
#!/usr/bin/env ruby | |
require 'optparse' | |
options = {} | |
OptionParser.new do |opts| | |
opts.banner = 'Usage: ruby-methods-stats [options]... [file]...' | |
opts.on( | |
'-h', | |
'--help', |
class User < ActiveRecord::Base | |
self.roles | |
@roles ||= %w(admin moderator contributor) | |
end | |
end | |
# > User.roles | |
# => ["admin", "moderator", "contributor"] |