Skip to content

Instantly share code, notes, and snippets.

View dukex's full-sized avatar
✔️
Verified Account

Duke dukex

✔️
Verified Account
View GitHub Profile
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@ld100
ld100 / ArchLinuxWSL2.md
Last active April 15, 2024 03:09
Steps for setting up Arch Linux on WSL2

Migrating from Ubuntu on WSL to ArchLinux on WSL2

Obsolete notice

This document was created back in 2020 and might not be actual nowadays. It is not supported anymore, so use thise information at your own risk.

Upgrading to WSL 2

  • Download WSL2 Kernel
  • run wsl --set-default-version 2 in windows command line, so that all future WSL machine will use WSL2.
@viniciusteles
viniciusteles / gist:556029
Created August 29, 2010 06:20
Sete Atitudes para Hackear a Indústria de Software
Sete Atitudes para Hackear a Indústria de Software
By Klaus Wuestefeld
1) Torne-se excelente.
Seja realmente bom em alguma coisa. Não fique só choramingando ou
querendo progredir às custas dos outros. Não pense q pq vc sentou 4
anos numa faculdade ouvindo um professor falar sobre software q vc
sabe alguma coisa. Jogador de futebol não aprende a jogar bola tendo
@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active March 8, 2024 02:11
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@fnando
fnando / dev.conf
Created July 23, 2011 09:00
Nginx configuration for SSH tunnel
upstream tunnel {
server 127.0.0.1:3000;
}
server {
listen 80;
server_name dev.codeplane.com br.dev.codeplane.com;
location / {
proxy_set_header X-Real-IP $remote_addr;
@danilobatistaqueiroz
danilobatistaqueiroz / Best_Practices.md
Last active July 24, 2023 18:12
RabbitMQ and CloudAMQP

To get optimal performance, make sure your queues stay as short as possible all the time.
Longer queues impose more processing overhead.
We recommend that queues should always stay around 0 for optimal performance.

Em cenários com muitos consumers e publishers, o ideal é centralizar a criação de exchanges e queues, removendo essa permissão deles e fazendo essa gestão por uma equipe de admin.

Para garantir a entrega das mensagens o correto é usar consumer ack, broker ack e durable queue com persistent messages.
Pode-se utilizar quorum queues dependendo do cenário.

@scottsbaldwin
scottsbaldwin / linearregression.rb
Created February 3, 2012 23:14
Ruby Linear Regression Calculator
# Adapted from a C# example here:
# http://stackoverflow.com/questions/43224/how-do-i-calculate-a-trendline-for-a-graph
# And thanks to John Esser for helping figure out how to
# calculate the targets to stabilize a negative slope!
class LinearRegression
attr_accessor :slope, :intercept
# Pass in an array of values to get the regression on
sudo port -f uninstall installed
sudo rm -rf \
/opt/local \
/etc/manpaths.d/macports \
/etc/paths.d/macports \
/Applications/DarwinPorts \
/Applications/MacPorts \
/Library/LaunchDaemons/org.macports.* \
/Library/Receipts/DarwinPorts*.pkg \
# Adapted from a C# example here:
# http://stackoverflow.com/questions/43224/how-do-i-calculate-a-trendline-for-a-graph
# And thanks to John Esser for helping figure out how to
# calculate the targets to stabilize a negative slope!
class LinearRegression
attr_accessor :slope, :intercept
# Pass in an array of values to get the regression on
@yogthos
yogthos / gist:3260456
Created August 4, 2012 23:01
RSS in Clojure
(ns rss
(:use [clojure.xml :only [emit]])
(:import java.util.Date))
(defn format-time [time]
(.format (new java.text.SimpleDateFormat
"EEE, dd MMM yyyy HH:mm:ss ZZZZ") time))
(defmacro tag [id attrs & content]
`{:tag ~id :attrs ~attrs :content [~@content]})