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
finToHex : Fin 16 -> Char | |
finToHex FZ = '0' | |
finToHex (FS FZ) = '1' | |
finToHex (FS (FS FZ)) = '2' | |
finToHex (FS (FS (FS FZ))) = '3' | |
finToHex (FS (FS (FS (FS FZ)))) = '4' | |
finToHex (FS (FS (FS (FS (FS FZ))))) = '5' | |
finToHex (FS (FS (FS (FS (FS (FS FZ)))))) = '6' | |
finToHex (FS (FS (FS (FS (FS (FS (FS FZ))))))) = '7' | |
finToHex (FS (FS (FS (FS (FS (FS (FS (FS FZ)))))))) = '8' |
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 Main | |
import Data.Vect | |
import Data.Vect.Views | |
data Total : {a : Type} -> (a -> a -> Type) -> (x : a) -> (y : a) -> Type where | |
LR : x `order` y -> Total order x y | |
RL : y `order` x -> Total order x y | |
interface TotalOrder a (order : a -> a -> Type) | order where |
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
// длинный вариант | |
function getValue(id, cache, retrieveValue) { | |
return new Promise(function(ful, rej) { | |
if(cache.has(id)) { | |
ful(cache.get(id)) | |
} else { | |
rej(false); | |
} | |
}).catch(function() { |
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
function getValue(id, cache, retrieveValue) { | |
if(cache.has(id)) { | |
return cache.get(id); | |
} else { | |
return new Promise(function(ful, rej) { | |
retrieveValue(id, ful, rej); | |
}); | |
} | |
} |
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
function getValue(id, cache, retrieveValue) { | |
if(cache.has(id)) { | |
return cache.get(id); | |
} else { | |
// синхронный запрос к удаленному источнику | |
return retrieveValue(id); | |
} | |
} |
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
Server Software: nginx/1.4.6 | |
Server Hostname: paperpaper.ru | |
Server Port: 80 | |
Document Path: / | |
Document Length: 34971 bytes | |
Concurrency Level: 1 | |
Time taken for tests: 413.202 seconds | |
Complete requests: 1000 |
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
Server Software: nginx/1.4.6 | |
Server Hostname: paperpaper.ru | |
Server Port: 80 | |
Document Path: / | |
Document Length: 37679 bytes | |
Concurrency Level: 1 | |
Time taken for tests: 711.723 seconds |
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
fs = require('fs') | |
Flightplan = require("./.node_modules/flightplan") # we need to install flightplane to .node_modules for meteor to ignore it | |
path = require('path') | |
plan = new Flightplan() | |
releaseFile = "release.tar.tgz" # name of the bundle generated by meteor | |
workPath = '/home/user/path' # path to the project folder | |
releaseFolder = 'rel' + Date.now() |
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
do fn # if not returning value or I don't care | |
fn() # if returning value | |
fn 1 | |
fn fn2() | |
fn(fn2(), 1) | |
fn fn2(1, 2, 3) # 4, 5 ... |
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
exec = require('child_process').exec | |
ssh = require 'NodeSSH' | |
scp = require 'scp' | |
deploy = (host, name, pass, path, start = true, port=3001) -> | |
client = new ssh host, name, pass | |
console.log 'connecting to server' | |
client.connect -> | |
client.once 'data', -> | |
console.log 'cleaning old code' | |
client.write "cd #{path}\r\n" |