Skip to content

Instantly share code, notes, and snippets.

View yrgoldteeth's full-sized avatar

Nicholas Fine yrgoldteeth

View GitHub Profile
@vjt
vjt / awesome-nginx.conf
Created January 31, 2011 19:43
*AWESOME* nginx configuration for Ruby/Rack web applications
#
# mmm m m mmm mmm mmm mmmmm mmm
# " # "m m m" #" # # " #" "# # # # #" #
# m"""# #m#m# #"""" """m # # # # # #""""
# "mm"# # # "#mm" "mmm" "#m#" # # # "#mm"
#
# nginx configuration For Ruby/Rack web applications
#
# Cooked up with style, care and a bit of *secret*
# nerdy spice. :-)
@benolee
benolee / 00-creating-a-ruby-extension.md
Last active August 6, 2017 17:18
how easy it is to create and load a C extension in ruby

create a new dir

$ mkdir /tmp/ruby
$ cd /tmp/ruby

create extconf.rb

#!/usr/bin/env bash
#
# Wraps curl with a custom-drawn progress bar. Use it just like curl:
#
# $ curl-progress -O http://example.com/file.tar.gz
# $ curl-progress http://example.com/file.tar.gz > file.tar.gz
#
# All arguments to the program are passed directly to curl. Define your
# custom progress bar in the `print_progress` function.
#
#!/usr/bin/env bash
function aliasestext()
{
cat<<EOF
alias gplom="git pull origin master"
alias gpsom="git push origin master"
alias gcow='git checkout work'
alias gcom='git checkout master'
alias gmw='git merge work'
#!/usr/bin/env bash
git config -l | grep -q -i nicholas
if [ $? -ne 0 ]
then
echo "Setting Git Configs (username, email, color.ui)"
git config --global user.name "Nicholas Fine"
git config --global user.email [email protected]
git config --global color.ui true
#!/usr/bin/env bash
# This is my setup for Vim. This will install the janus set of plugins
# as well as create my specific vim customizations
# Ensure required packages are installed.
REQUIRED_PACKAGES="bash vim git curl"
for package in $REQUIRED_PACKAGES
do
command -v $package >/dev/null && continue || { echo "Package: $package is required, please install it"; exit 1; }
@davidcelis
davidcelis / nginx.conf
Last active June 15, 2018 13:11
Nginx configuration to redirect HTTP traffic to HTTPS (Puma)
upstream puma {
server unix:///var/www/app/shared/tmp/sockets/puma.sock fail_timeout=0;
}
server {
listen 80 default deferred;
server_name example.com;
rewrite ^/(.+) https://example.com/$1 permanent;
}
@Kartones
Kartones / postgres-cheatsheet.md
Last active November 15, 2024 21:14
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)