$ rails g model User
belongs_to
has_one
| +------+------+-------------+ | |
| | pp | ss | modified_at | | |
| +------+------+-------------+ | |
| | | 0 | 2017-05-09 | | |
| | . | 0 | 2017-04-29 | | |
| | 0 | 9 | 2014-02-13 | | |
| | 1 | 10 | 2016-07-14 | | |
| | 2 | 3 | 2009-01-12 | | |
| | 3 | 2 | 2012-05-15 | | |
| | 5 | 6 | 2011-11-29 | |
| regions = { :us => 8, :eu => 5 } | |
| terminal = 0 | |
| hosts = [] | |
| regions.each do |k,v| | |
| 1.upto(v).each do |c| | |
| terminal += 1 | |
| host = "hv%02d-1-%s-pmx.cloudstrap.io" % [c,k] | |
| hosts << host | |
| halias = host.split('.')[0] |
| #!/usr/bin/env ruby | |
| # varnalab-cli isp tcv 00:11:22:33:44:55:66 | |
| # varnalab-cli <cmd> <isp_name|release> [mac|ip] | |
| arg_one = %w(tcv mtel release) | |
| puts "ok" if arg_one.include?("tcv") | |
| puts "ok" if arg_one.include?("tcvq") | |
| ip_range = [ |
| p = 3000 | |
| cd = (p * ( 10.00/100 )) | |
| dd = ((p-cd)*( 5.00/100 )) | |
| cash = p - cd - dd | |
| puts "=" * 40 | |
| puts " %0.2f - %0.2f - %0.2f = %0.2f" % [ p, cd, dd, cash ] | |
| puts "=" * 40 |
| 777-a-bingo.us | |
| 777-a-bonus.us | |
| 777-a-chance.us | |
| 777-a-game.us | |
| 777-a-lucky.us | |
| 777-a-profit.us | |
| bet-a-bet.us | |
| bet-a-winner.us | |
| bet-and-gain.us | |
| bet-and-slot.us |
| #!/bin/bash | |
| DELETE=0 | |
| target="/tmp" | |
| # this line only shows what will be deleted | |
| if [ ${DELETE} == "0" ]; then | |
| echo /usr/bin/find ${target} -type f -mtime +14 -printf "%CY%Cm%Cd " -exec ls -al {} \; | |
| else | |
| echo /usr/bin/find ${target} -type f -mtime +14 -printf "%CY%Cm%Cd " -exec rm -v {} \; | |
| fi |
| #!/usr/bin/env ruby | |
| # encoding: utf-8 | |
| # english | |
| dice_red_en = %w(rabbit rabbit rabbit rabbit rabbit rabbit sheep sheep pig pig horse fox) | |
| dice_blue_en = %w(rabbit rabbit rabbit rabbit rabbit rabbit sheep sheep pig pig cow wolf) | |
| # bulgarian | |
| dice_red_bg = %w(заек заек заек заек заек заек овца овца прасе прасе кон лисицa) | |
| dice_blue_bg = %w(заек заек заек заек заек заек овца овца прасе прасе крава вълк) |
| <?xml version='1.0' encoding='utf-8'?> | |
| <xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'> | |
| <xsl:output omit-xml-declaration="yes" indent="no" /> | |
| <xsl:param name="consecutiveMessage" /> | |
| <xsl:param name="bulkTransform" /> | |
| <xsl:param name="timeFormat" /> | |
| <xsl:template match="/"> | |
| <xsl:choose> | |
| <xsl:when test="$consecutiveMessage = 'yes'"> |
| # ruby script | |
| w = %w(redis-benchmark redis-check-aof redis-check-dump redis-cli redis-sentinel | |
| redis-server) | |
| w.each { |e| | |
| puts "ln -s /usr/local/bin/#{e} /bin/#{e}" | |
| } |