This file contains hidden or 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
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) |
This file contains hidden or 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
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 |
This file contains hidden or 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
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 |
This file contains hidden or 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
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 |
This file contains hidden or 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
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; |
This file contains hidden or 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
Your new droplet has been created! | |
You can access it using the following credentials: | |
IP Address: 198.211.110.249 | |
Username: root | |
Password: xuzbnmtdvzlr |
This file contains hidden or 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
class GridBounds | |
constructor: (bounds) -> | |
[ 'min', 'max' ].forEach (mm) => | |
[ 'x', 'y' ].forEach (xy) => | |
@[ mm + xy.toUpperCase() ] = Math[mm] bounds[0][xy], bounds[1][xy] |
This file contains hidden or 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
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) |
This file contains hidden or 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
gzip on; | |
gzip_min_length 1100; | |
gzip_comp_level 5; | |
gzip_types text/plain text/css text/javascript text/xml text/json; |
This file contains hidden or 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
# 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 |