Skip to content

Instantly share code, notes, and snippets.

now = Time.now
s = Schedule.new now
s.add_recurrence_rule Rule.weekly(4)
s.add_exception_rule Rule.weekly(12)
s.add_recurrence_rule Rule.weekly(13)
module Sidekiq
class AV_lb1 < Web; include Sidekiq; end
class AV_lb2 < Web; include Sidekiq; end
class AV_lb3 < Web; include Sidekiq; end
end
%w/lb1 lb2 lb3/.each do |node_name|
cls = "Sidekiq::AV_#{node_name}".constantize
17:16:44 ~/work $ cat foo.rb
#!/usr/bin/env ruby
require 'acme/bleach'
x = 45
x += 13
puts "x = #{x}"
17:18:21 ~/work $ ./foo.rb
11:47:11 ~/example $ cat -> foo.rb
require 'acme/bleach'
puts "Foo"
11:47:28 ~/example $ cat foo.rb
require 'acme/bleach'
puts "Foo"
11:47:34 ~/example $ ruby foo.rb
Foo
upstream destico {
server unix:/tmp/destico.socket fail_timeout=0;
}
server {
listen 80;
server_name localhost;
root /home/destico/destico-app/current/public;
access_log /var/log/nginx/destico_access.log;
Your new droplet has been created!
You can access it using the following credentials:
IP Address: 198.211.110.249
Username: root
Password: xuzbnmtdvzlr
class GridBounds
constructor: (bounds) ->
[ 'min', 'max' ].forEach (mm) =>
[ 'x', 'y' ].forEach (xy) =>
@[ mm + xy.toUpperCase() ] = Math[mm] bounds[0][xy], bounds[1][xy]
public string encriptaRijndael(string ccNum)
{
IniFile ini = new IniFile("C:\\Adquira/config/Rijndael.properties");
byte[] keyArray = UTF8Encoding.Default.GetBytes(ini.IniReadValue("Info", "KEY"));
byte[] resultArray = new byte[0];
byte[] toEncryptArray = UTF8Encoding.UTF8.GetBytes(ccNum);
try
{
if (keyArray.Length > 0)
gzip on;
gzip_min_length 1100;
gzip_comp_level 5;
gzip_types text/plain text/css text/javascript text/xml text/json;
# 2a regular - needs fat arrow to keep access to defined context
call_method args, (result) =>
if result
do_something_with result
else
some_error_with_or_without result
# 2b on context switching mode - no access to defined context