Skip to content

Instantly share code, notes, and snippets.

Avatar

Pete McWilliams petemcw

View GitHub Profile
View testing_http_auth_in_sinatra.rb
require 'rubygems'
require 'sinatra'
require 'sinatra/test/unit'
require 'application'
require 'base64'
class ApplicationTest < Test::Unit::TestCase
def test_without_authentication
get '/protected'
View fresh-install.mkd
@napcs
napcs / .vimrc
Last active Jan 16, 2021
Set up Vim on Mac, Linux, or Windows. For Mac and Linux: sh <(curl -s https://gist.githubusercontent.com/napcs/532968/raw/vim.sh)
View .vimrc
if has('win32') || has ('win64')
let $VIMHOME = $HOME."/Dropbox/dotfiles/.vim"
if !empty($CONEMUBUILD)
set term=xterm
set t_Co=256
let &t_AB="\e[48;5;%dm"
let &t_AF="\e[38;5;%dm"
endif
@onyxfish
onyxfish / elections.chicagotribune.com.vcl
Created Nov 3, 2010
Elections Center Varnish Configuration File
View elections.chicagotribune.com.vcl
backend app1 {
.host = "1.1.1.1";
.port = "80";
}
backend app2 {
.host = "2.2.2.2";
.port = "80";
}
@ticean
ticean / apache-site.conf.erb
Created Dec 10, 2010 — forked from yevgenko/apache-site.conf.erb
chef magento roles examples
View apache-site.conf.erb
<% if @params[:ssl] %>
<VirtualHost <%= node[:ipaddress] %>:443>
ServerName <% if node[:magento][:server][:secure_domain] %><%= node[:magento][:server][:secure_domain] %><% else %><%= @params[:server_name] %><% end %>
SSLEngine on
SSLCertificateKeyFile ssl/<%= @params[:server_name] %>.pem
SSLCertificateFile ssl/<%= @params[:server_name] %>.pem
SSLProtocol all
SSLCipherSuite ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
<% else %>
@petemcw
petemcw / .gitignore
Created Dec 16, 2010
What to ignore from Magento in Git
View .gitignore
# Magento Connect 2 cache directories and files
downloader/pearlib/cache/
downloader/*.cfg
# Magento runtime media files
media/catalog/product/cache/
media/tmp/
media/js/
media/css/
media/.thumbs/
@mojombo
mojombo / vwilight.vim
Created Jan 26, 2011
vwilight.vim: A TRUE Twilight color theme for Vim
View vwilight.vim
" Vim color file
" Converted from Textmate theme Twilight using Coloration v0.2.5 (http://github.com/sickill/coloration)
set background=dark
highlight clear
if exists("syntax_on")
syntax reset
endif
@petemcw
petemcw / my.cnf
Created Feb 25, 2011
Ubuntu MySQL 5.1 Configuration - 4GB RAM, Heavy InnoDB
View my.cnf
# The MySQL database server configuration file.
#
# DESC: InnoDB mainly, heavy queries, fewer connections, 4GB RAM
#
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
# This was formally known as [safe_mysqld]. Both versions are currently parsed.
@stefanfoulis
stefanfoulis / osx_developer_installation.rst
Last active Dec 23, 2019
Instructions on how to setup an OSX developer machine for (python/django) development
View osx_developer_installation.rst

OSX Developer System installation

This guide assumes a fresh install of Mac OSX 10.7 Lion.

Brew User

@petemcw
petemcw / key_generator.rb
Created Apr 27, 2011
Random Key Generator
View key_generator.rb
class KeyGenerator
require "digest/sha1"
def self.generate(length = 12)
Digest::SHA1.hexdigest(Time.now.to_s + rand(567891234).to_s)[1..length]
end
end