The following looks much more like a "package" without the extra space:
app.get('/', function(req, res){
res.send('Hello World');
});
app.get('/', function(req, res) {
<?php | |
/* | |
* Place this with the rest of your rules. | |
* Doesn't need to be in an array as there are no pipes. | |
* Password is required with a minimum of 6 characters | |
* Should have at least 1 lowercase AND 1 uppercase AND 1 number | |
*/ | |
$rules = [ | |
'password' => 'required|min:6|regex:/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d).+$/' | |
]; |
find /var/lib/docker/containers/ -type f -name "*.log" -delete |
<?php | |
$f = fopen("data.txt", "r"); | |
fread($f, 10); | |
fread($f, 10); | |
// Run with: strace -e trace=read php test2. | |
/* |
var test = | |
[ | |
['label0', 100, 200, 300, 400, 500], | |
['label0', 200, 100, 400, 300, 500], | |
['label1', 100, 100, 100, 100, 100], | |
['label1', 100, 100, 100, 100, 100], | |
['label2', 0, 0, 0, 0, 0], | |
['label2', 0, 1, 1, 0, 0], | |
]; |
// === Arrays | |
var [a, b] = [1, 2]; | |
console.log(a, b); | |
//=> 1 2 | |
// Use from functions, only select from pattern | |
var foo = () => [1, 2, 3]; |
require 'openssl' | |
require 'base64' | |
require 'json' | |
require 'httpclient' | |
http = HTTPClient.new(:agent_name => useragent) | |
key = "" #The Private key | |
login_info = {:guid => "00000000-0000-0000-0000-000000000000", | |
:password => "PASSWORD", | |
:username => "USERNAME", |
/* | |
Serve is a very simple static file server in go | |
Usage: | |
-p="8100": port to serve on | |
-d=".": the directory of static files to host | |
Navigating to http://localhost:8100 will display the index.html or directory | |
listing file. | |
*/ | |
package main |
So, I was developing a node shell script and wanted to determine the time it took from start, to finish to generate the output of a file. Simple, right? It is, but the problem is that if you want a clean way to do it... you have to develop it, otherwise you'll have a lot of wrapper code surrounding methods and such. So I wrote a small method to simplify it even further.
Benchmark Method:
function benchmark (method) {
var start = +(new Date);
method && method(function (callback) {
var end = +(new Date);
package main | |
import ( | |
"bytes" | |
"compress/gzip" | |
"database/sql/driver" | |
"errors" | |
"fmt" | |
"github.com/jmoiron/sqlx" | |
_ "github.com/mattn/go-sqlite3" |