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
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 |
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.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 |
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 |
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
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
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
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
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
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
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 |