Skip to content

Instantly share code, notes, and snippets.

@tbeseda
tbeseda / basic_auth_app.coffee
Created December 29, 2011 21:19
Basic HTTP Auth with Express for Node.js
express = require 'express'
app = express.createServer()
auth = express.basicAuth 'yourmom', 'p4ssw0rd'
app.get '/', auth, (req, res) ->
res.send your_super_secret_stuff
app.listen 3000, ->
console.log "Listening on #{port}"
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://npmjs.org/install.sh | sh
@noelbundick
noelbundick / LICENSE
Last active January 13, 2019 03:11
aci-compose
MIT License
Copyright (c) 2018 Noel Bundick
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@tkafka
tkafka / LICENSE.txt
Last active September 5, 2019 13:38
Drop-in replacement for ReactCSSTransitionGroup that uses velocity.js instead of CSS transforms. Add your own transitions to `transitions` hash.
The MIT License (MIT)
Copyright (c) 2014 Tomas Kafka
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@axis7818
axis7818 / !Axis7818-zsh-configuration.md
Last active April 10, 2020 22:18
axis7818 zsh configuration

Axis7818 ZSH Configuration

Here are the various configurations and rc files I use to configure my terminal environment.

I use iTerm2 and oh-my-zsh

The iTerm2 color theme comes from here

.zshrc: configuration for my zsh behavior axis7818.zsh-theme: PS1 customization

@djsutherland
djsutherland / example.hmm
Created November 1, 2011 05:10
Code for a Hidden Markov Model, along with some sample data / parameters for testing.
4 # number of states
START
COLD
HOT
END
3 # size of vocab
1
2
3
@nodesocket
nodesocket / bootstrap.flatten.css
Last active April 1, 2021 23:37
Below are simple styles to "flatten" bootstrap. I didn't go through every control and widget that bootstrap offers, only what was required for https://commando.io, so your milage may vary.
/* Flatten das boostrap */
.well, .navbar-inner, .popover, .btn, .tooltip, input, select, textarea, pre, .progress, .modal, .add-on, .alert, .table-bordered, .nav>.active>a, .dropdown-menu, .tooltip-inner, .badge, .label, .img-polaroid {
-moz-box-shadow: none !important;
-webkit-box-shadow: none !important;
box-shadow: none !important;
-webkit-border-radius: 0px !important;
-moz-border-radius: 0px !important;
border-radius: 0px !important;
border-collapse: collapse !important;
background-image: none !important;
@paulodeleo
paulodeleo / .tmux.conf
Last active July 15, 2022 10:16
Tmux configuration to enable mouse scroll and mouse panel select, taken from: http://brainscraps.wikia.com/wiki/Extreme_Multitasking_with_tmux_and_PuTTY
# Make mouse useful in copy mode
setw -g mode-mouse on
# Allow mouse to select which pane to use
set -g mouse-select-pane on
# Allow mouse dragging to resize panes
set -g mouse-resize-pane on
# Allow mouse to select windows
@jorinvo
jorinvo / challenge.md
Last active April 21, 2023 17:14
This is a little challenge to find out which tools programmers use to get their everyday tasks done quickly.

You got your hands on some data that was leaked from a social network and you want to help the poor people.

Luckily you know a government service to automatically block a list of credit cards.

The service is a little old school though and you have to upload a CSV file in the exact format. The upload fails if the CSV file contains invalid data.

The CSV files should have two columns, Name and Credit Card. Also, it must be named after the following pattern:

YYYYMMDD.csv.

@papes1ns
papes1ns / dexec.sh
Created May 17, 2023 02:15
dexec.sh
#!/usr/bin/env bash
set -eu # do not proceed on error
if [ $# -lt 1 ] || [ "$1" = "--help" ] || [ "$1" = "-h" ]; then
cat <<EOF
Quick command to get a shell inside a running docker container.
Usage: dexec [container_name] [command]