This file contains 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
| Variable | Example | Notes | | |
| --- | --- | --- | | |
| `date` | Feb 21, 2016 | The current date | | |
| `time` | 14:17 | The current time | | |
| `order.code` | 01234567890123456 | | |
| `order.reference` | XXX-YYY-ZZZ | | |
| `order.external_reference` | BK-1112302 | | |
| `order.voucher_code` | XYWJ02222X | | |
| `customer.full_name` | John Smith | | |
| `customer.first_name` | John | |
This file contains 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
Object.clone = function(obj) { | |
return Object.create(Object.getPrototypeOf(obj), Object.getOwnPropertyNames(obj).reduce(function(memo, name) { | |
return (memo[name] = Object.getOwnPropertyDescriptor(obj, name)) && memo; | |
}, {})); | |
} |
This file contains 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
function Stream(host, port, mode) { ... } | |
Stream.new = function(host, port, mode) { return new Stream(host, port, mode); } | |
Stream.prototype = Object.create(Object.prototype, { | |
readable: { get: function() { ... }, | |
writable: true, enumerable: false, configurable: true }, | |
writable: { get: function() { ... }, | |
writable: true, enumerable: false, configurable: true }, |
This file contains 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
location / { | |
index index.php index.html index.htm; | |
try_files $uri index.php$uri?$args; | |
} | |
error_page 500 502 503 504 /50x.html; | |
location = /50x.html { | |
root html; | |
} |
This file contains 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
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
fastcgi_param QUERY_STRING $query_string; | |
fastcgi_param REQUEST_METHOD $request_method; | |
fastcgi_param CONTENT_TYPE $content_type; | |
fastcgi_param CONTENT_LENGTH $content_length; | |
fastcgi_param SCRIPT_NAME $fastcgi_script_name; | |
fastcgi_param REQUEST_URI $request_uri; | |
fastcgi_param DOCUMENT_URI $document_uri; |
This file contains 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
user www-data; | |
worker_processes 4; | |
error_log /var/log/nginx/nginx.log info; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 1024; | |
multi_accept on; | |
} |
This file contains 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
// Event Emitter Class | |
// ringo/events.js | |
export('EventEmitter'); | |
function EventEmitter() { | |
} | |
EventEmitter.prototype = Object.create(Object.prototype, |
This file contains 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
var engine = require('ringo/engine'); | |
var script = 'var y = x * x'; | |
var scope = engine.evaluateString(script, { x: 5 }); | |
// scope.x = 5 | |
// scope.y = 25 |
This file contains 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
// EXAMPLE OF IMAGE | |
var image = require('image'); | |
image = image.createImage(blob); | |
// Methods | |
image.resize(width, height, preserveAspectRatio); | |
image.crop(from_x, from_y, to_x, to_y); | |
image.rotate(degrees); |
This file contains 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
<?php | |
$a = 1; | |
$b = 2; | |
$c = 3; | |
$d = $c | $b; | |
if ($d & $a) { | |
// This line is reached and it shouldn't be |
NewerOlder