Skip to content

Instantly share code, notes, and snippets.

https = require 'https'
module.exports.request = ( options, success_handler, error_handler) ->
req_data = if options.data? then JSON.stringify options.data else ""
options['headers']['Content-length'] = req_data.length
req = https.request options, (res) ->
data = ''
res.on 'data', (c) ->
data += c
module.exports = (args) ->
_get_callback = (args, pos) ->
if args.length > pos - 1
candidate = args[args.length-pos]
if candidate && typeof candidate == 'function'
candidate
win = ->
fail = ->
if candidate = _get_callback args, 1
# 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
gzip on;
gzip_min_length 1100;
gzip_comp_level 5;
gzip_types text/plain text/css text/javascript text/xml text/json;
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)
class GridBounds
constructor: (bounds) ->
[ 'min', 'max' ].forEach (mm) =>
[ 'x', 'y' ].forEach (xy) =>
@[ mm + xy.toUpperCase() ] = Math[mm] bounds[0][xy], bounds[1][xy]
Your new droplet has been created!
You can access it using the following credentials:
IP Address: 198.211.110.249
Username: root
Password: xuzbnmtdvzlr
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;
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
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