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
| require 'rbnacl' | |
| require 'base64' | |
| class Example | |
| attr_reader :secret_box, :index_key | |
| def initialize | |
| key = RbNaCl::Random.random_bytes(RbNaCl::SecretBox.key_bytes) | |
| @index_key = RbNaCl::Random.random_bytes(RbNaCl::SecretBox.key_bytes) | |
| @secret_box = RbNaCl::SecretBox.new(key) |
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
| 1) Make sure YARN is installed (https://yarnpkg.com/en/docs/install) | |
| 2) Install rails 5.1 beta | |
| gem install rails --pre | |
| 3) Create new app | |
| rails new myapp --webpack=vue | |
| 4) Create home controller | |
| rails g controller home index --no-assets |
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
| CREATE EXTENSION file_fdw; | |
| CREATE SERVER import FOREIGN DATA WRAPPER file_fdw; | |
| CREATE FOREIGN TABLE table1_import ( | |
| col1 text, | |
| col2 text, | |
| ... | |
| ) SERVER import OPTIONS ( filename '/path/to/file.csv', format 'csv' ); |
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
| Dependencies: | |
| 1. Python 2.7 | |
| 2. Redis | |
| 3. PostgreSQL | |
| 4. Node.js | |
| 1. Install Python 2.7 | |
| Get python 2.7 from IUS | |
| rpm -i https://rhel6.iuscommunity.org/ius-release.rpm | |
| yum install python27 python27-virtualenv |
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
| Rakefile | |
| ======== | |
| require 'rake/testtask' | |
| Rake::TestTask.new do |t| | |
| t.libs << 'test' | |
| t.libs << 'lib' | |
| t.test_files = FileList['test/**/*_test*.rb'] | |
| t.verbose = true | |
| end |
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
| require 'csv' | |
| class MyCSV < CSV | |
| def <<(row) | |
| # make sure headers have been assigned | |
| if header_row? and [Array, String].include? @use_headers.class | |
| parse_headers # won't read data for Array or String | |
| self << @headers if @write_headers | |
| end |
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
| Perhaps the most important | |
| - max_connections: the number of concurrent sessions. rule-of-thumb formula is "number of spindles+number of processors+X" | |
| - work_mem : the maximal amount of memory to be used for intermediate results such as hash tables. | |
| - shared_buffers the amount of memory dedicated to 'pinned' buffer space.Normally it is advised to set it to about 1/4...1/2 of all available "free" memory | |
| - effective_cache_size the amount of memory assumed to be used by the OS's LRU buffers. Set too all available "free" memory. 3/4 aggressive, reasonable amount | |
| - random_page_cost : an estimate for the relative cost of disk seeks. |
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
| in: | |
| type: file | |
| path_prefix: fail.csv | |
| parser: | |
| type: csv | |
| charset: utf-8 | |
| delimiter: ',' | |
| stop_on_invalid_record: true | |
| columns: | |
| - {name: a, type: string} |
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
| XMPP | |
| ---- | |
| - Extensions | |
| - XEP-0364 OTR | |
| - XEP-0357 Push Notifications | |
| - XEP-XXXX OMEMO(multiclient end-to-end) (Adaption of Axolotl now known as signal protocol) | |
| - Chatsecure for android and ios. | |
| Conversations.io to become the new ChatSecure Android. | |
| - Zom is fork of chatsecure |
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
| require 'fluent/plugin/parser' | |
| require 'csv' | |
| module Fluent | |
| module Plugin | |
| class CSV2Parser < ValuesParser | |
| Plugin.register_parser('csv2', self) |