apt-get install zsh | |
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" | |
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting | |
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions | |
nano ~/.zshrc | |
# add zsh-autosuggestions extract zsh-syntax-highlighting to plugins | |
source ~/.zshrc |
import org.bouncycastle.util.encoders.Hex; | |
import org.web3j.crypto.*; | |
import java.math.BigInteger; | |
public class ECCExample { | |
public static String compressPubKey(BigInteger pubKey) { | |
String pubKeyYPrefix = pubKey.testBit(0) ? "03" : "02"; | |
String pubKeyHex = pubKey.toString(16); | |
String pubKeyX = pubKeyHex.substring(0, 64); |
'use strict' | |
const MAP = { | |
'A': '.-', | |
'B': '-...', | |
'C': '-.-.', | |
'D': '-..', | |
'E': '.', | |
'F': '..-.', | |
'G': '--.', |
var amqp = require('amqplib/callback_api'); | |
// if the connection is closed or fails to be established at all, we will reconnect | |
var amqpConn = null; | |
function start() { | |
amqp.connect(process.env.CLOUDAMQP_URL + "?heartbeat=60", function(err, conn) { | |
if (err) { | |
console.error("[AMQP]", err.message); | |
return setTimeout(start, 1000); | |
} |
namespace Infrastructure | |
{ | |
using System; | |
using System.Globalization; | |
using System.IO; | |
using System.Linq; | |
using Nancy; | |
using Util; |
Some thoughts on using node-postgres in a web application
This is the approach I've been using for the past year or so. I'm sure I'll change and it will change as I grow & am exposed to more ideas, but it's worked alright for me so far.
I would definitely use a single pool of clients throughout the application. node-postgres ships with a pool implementation that has always met my needs, but it's also fine to just use the require('pg').Client
prototype and implement your own pool if you know what you're doing & have some custom requirements on the pool.
Moved to git repository: https://github.com/denji/nginx-tuning
For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.
Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon
with HyperThreading enabled, but it can work without problem on slower machines.
You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.
// <copyright file="LeastRecentlyUsedCache.cs" company="http://www.sinbadsoft.com"> | |
// Copyright (c) Chaker Nakhli 2013 | |
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the | |
// License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by | |
// applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, | |
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language | |
// governing permissions and limitations under the License. | |
// </copyright> | |
// <author>Chaker Nakhli</author> | |
// <email>Chaker.Nakhli@sinbadsoft.com</email> |