Skip to content

Instantly share code, notes, and snippets.

@katta
katta / mvncolor.sh
Created June 15, 2011 18:50
Script to add colors to maven output
#!/usr/bin/env bash
# Formatting constants
export BOLD=`tput bold`
export UNDERLINE_ON=`tput smul`
export UNDERLINE_OFF=`tput rmul`
export TEXT_BLACK=`tput setaf 0`
export TEXT_RED=`tput setaf 1`
export TEXT_GREEN=`tput setaf 2`
export TEXT_YELLOW=`tput setaf 3`
@branneman
branneman / better-nodejs-require-paths.md
Last active June 29, 2024 16:00
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@staltz
staltz / introrx.md
Last active July 22, 2024 09:31
The introduction to Reactive Programming you've been missing
@rothgar
rothgar / install-tmux
Last active April 5, 2023 06:53 — forked from ekiara/how_to_install_tmux_on_centos
Install tmux 1.9 on rhel/centos 6
# Install tmux on Centos release 6.5
# install deps
yum install gcc kernel-devel make ncurses-devel
# DOWNLOAD SOURCES FOR LIBEVENT AND MAKE AND INSTALL
curl -OL https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
tar -xvzf libevent-2.0.21-stable.tar.gz
cd libevent-2.0.21-stable
./configure --prefix=/usr/local
@vasanthk
vasanthk / System Design.md
Last active July 22, 2024 17:59
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?

Some of the Redis best practices content has moved

This content from this markdown file has moved a new, happier home where it can serve more people. Please check it out : https://docs.microsoft.com/azure/azure-cache-for-redis/cache-best-practices.

NOTE: Client specific guidance listed below is still valid and should still be considered. I will update this document once all content has been moved.

@Ron3
Ron3 / AWS-Kinesis初探
Created March 24, 2017 10:16
AWS Kinesis Stream
2017年3月20日 by Ron
Email: luodm03@qq.com(如有错误, 欢迎指证.如有问题,欢迎讨论)
配套代码的git地址:
git: git@github.com:Ron3/AWS-Kinesis.git
https: https://github.com/Ron3/AWS-Kinesis.git
一直以来,我都对Amazon Kinesis Stream(以下称Kinesis)充满着好奇,一直在慢慢啃文档,但相对来说,还是不够仔细的.那既然看了
就写个我对Kinesis的理解与总结吧.我第一次接触这个概念,应该是在第一次参加AWS会议的时候,卓动--张穗文分享了他们如何利用Kinesis做用户
行为分析的.然而,我也正好曾经做过一个类似的,但是我们没有借助Kinesis来做,是写把LOG写成文件,然后采用Rsync同步到另外一台机器,在写入MySQL.
@PeterRincker
PeterRincker / SortGroup.vim
Last active July 12, 2024 10:04
Sort groups of lines in vim
" :[range]SortGroup[!] [n|f|o|b|x] /{pattern}/
" e.g. :SortGroup /^header/
" e.g. :SortGroup n /^header/
" See :h :sort for details
function! s:sort_by_header(bang, pat) range
let pat = a:pat
let opts = ""
if pat =~ '^\s*[nfxbo]\s'
let opts = matchstr(pat, '^\s*\zs[nfxbo]')
@sebadoom
sebadoom / test.js
Created November 10, 2017 15:15
Using node-forge to create valid jwt.io keys
const jwt = require('jsonwebtoken')
const forge = require('node-forge')
const payload = {
hello: 'world'
}
var keypair = forge.rsa.generateKeyPair({ bits: 2048 });
keypair = {
public: forge.pki.publicKeyToPem(keypair.publicKey, 72),