##Заметки разработчика
$ ssh-keyscan -t rsa server_ip
очистить содержимое таблицы и сбросить id
###Редирект с помощью nginx
server {
#implemented by default, change if you need different ip or port
#listen *:80 | *:8000;
server_name test.com;
return 301 $scheme://www.test.com$request_uri;
}
#ruby 2.3.1 | |
require 'rbtree' # gem install rbtree | |
input = [ | |
{ start:1, end: 40, price: 500 }, | |
{ start:10, end: 22, price: 1000 }, | |
{ start:22, end: 33, price: 700 }, | |
{ start:39, end: 42, price: 800 }, | |
] |
new Promise(function(resolve){ | |
setTimeout(function() { | |
console.log(1); | |
resolve(); | |
}, 1000); | |
}).then(function() { | |
let nextPromise = new Promise(function(resolve){ | |
setTimeout(function() { | |
console.log(2); | |
resolve(); |
var Benchmark = require('benchmark'); | |
var suite = new Benchmark.Suite; | |
var testArray = []; | |
for (var s = 0; s < 100000; s++) { | |
testArray.push(Math.floor(Math.random() * 100)); | |
} | |
console.log('Testing caching') |
import itertools | |
import math | |
import sys | |
count = 0 | |
n = int(sys.argv[1]) | |
for left in itertools.permutations(range(1, n + 1)): | |
for right in itertools.permutations(range(1, n + 1)): | |
rIsGood = all(i + 1 != r for i, r in enumerate(right)) |
package main | |
import ( | |
"flag" | |
"io" | |
"log" | |
"net" | |
"net/http" | |
"strings" | |
) |
const request = require('superagent'); | |
const R = require('ramda'); | |
function get(url) { | |
return new Promise((resolve, reject) => { | |
request | |
.get(url) | |
.end((err, res) =>{ | |
if (err) { | |
reject(err); |
#!/bin/sh | |
# set -- $GIT_PARAMS | |
BRANCH_NAME=$(git symbolic-ref --short HEAD) | |
BRANCH_IN_COMMIT=0 | |
if [ -f $1 ]; then | |
BRANCH_IN_COMMIT=$(grep -c "\[$BRANCH_NAME\]" $1) | |
fi |
#!/bin/sh | |
go test ./... |