Use LuaRocks - a Lua package manager.
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
# Set the control character to Ctrl+Spacebar (instead of Ctrl+B) | |
set -g prefix C-space | |
unbind-key C-b | |
bind-key C-space send-prefix | |
# Set new panes to open in current directory | |
bind c new-window -c "#{pane_current_path}" | |
bind '"' split-window -c "#{pane_current_path}" | |
bind % split-window -h -c "#{pane_current_path}" |
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
properties = box.schema.space.create('properties') | |
properties:create_index('primary', {parts = {1, 'str'}, type = 'HASH', unique = true, if_not_exists = true}) | |
properties:replace({'node_id', 0}) | |
nodes = box.schema.space.create('nodes') | |
nodes:create_index('primary', {parts = {1, 'num', 2, 'str'}, type = 'TREE', unique = true, if_not_exists = true}) | |
function load_words() | |
local words = "/opt/dict/words" | |
for line in io.lines(words) do |
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
// Tarantool quick test | |
// Copyright, Dennis Anikin 2016 | |
// | |
// Quick disclaimer: | |
// | |
// This test shows 500K-1000K transactions per second on one CPU core | |
// and 600K-1600K queries per second on one CPU core. | |
// | |
// Based on the $6.57 per-month-price for the AWS t2.micro instance we can afford the tremendous number of 630bln queries for just $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
mholt [9:10 AM] | |
When using http.Get(), is it really necessary to read the full response body just to close it later? | |
[9:10] | |
The docs keep saying `Caller should close resp.Body when done reading from it.` and I keep seeing code like this: | |
``` | |
io.Copy(ioutil.Discard, resp.Body) | |
resp.Body.Close() | |
``` |
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
vendor | |
composer.phar |
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
<?php | |
use App\MessagePack\PackedMap; | |
use App\MessagePack\PackedMapTransformer; | |
use MessagePack\BufferUnpacker; | |
use MessagePack\Packer; | |
use MessagePack\PackOptions; | |
require __DIR__.'/vendor/autoload.php'; |
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
instances := $(basename $(wildcard *.lua)) | |
hosts := n4 n6 n11 n12 n16 n17 n18 n19 n20 | |
all: | |
echo "nothing" | |
start: clean | |
$(foreach i, $(instances), tarantoolctl $@ $i;) | |
stop: |
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
<?php error_reporting(E_ALL); | |
class BinaryTree { | |
private $content, $left, $right; | |
public function __construct($content, BinaryTree $left = null, BinaryTree $right = null) { | |
$this->content = $content; | |
$this->left = $left; | |
$this->right = $right; | |
} |
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
> curl http://tarantool.org/dist/public.key |apt-key add - | |
> echo "deb http://tarantool.org/dist/master/ubuntu/ trusty main" > /etc/apt/sources.list.d/tarantool.list | |
> apt-get update | |
> apt-get install tarantool luarocks rlwrap | |
> mkdir ~/.luarocks | |
> echo "rocks_servers = {[[http://rocks.tarantool.org/]]}" >> ~/.luarocks/config.lua | |
> luarocks install queue | |
```lua |
NewerOlder