Skip to content

Instantly share code, notes, and snippets.

View smakman's full-sized avatar

Jurjen Smakman smakman

View GitHub Profile
@vielhuber
vielhuber / .htaccess
Last active February 24, 2023 06:01
Apache: htaccess force www and https ssl #server
# force HTTPS and www.
RewriteEngine On
RewriteCond %{HTTP_HOST} (?!^www\.)^(.+)$ [OR]
RewriteCond %{HTTPS} off
RewriteRule ^ https://www.%1%{REQUEST_URI} [R=301,L]
# alternative way
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} !^www\. [NC]
@bodokaiser
bodokaiser / post-receive
Last active August 29, 2015 14:02
git post receive hook for nvm environments
#!/bin/bash
source $HOME/.bash_profile
set -u
set -e
# directory name
NAME=$(basename $(pwd) .git)
@tlrobinson
tlrobinson / post-receive
Last active December 7, 2022 08:15
Super simple git post-receive hook for Node.js + nvm + npm + node-foreman + init (Ubuntu) deployment
#!/usr/bin/env bash
set -u
set -e
export GIT_WORK_TREE="/var/www/example.com"
export NODE_VERSION="0.10"
echo "--> Checking out..."
git checkout -f
@lightscalar
lightscalar / rails.test.frameworks.md
Created September 17, 2011 18:58
Setting up my test environment with RSPEC/GUARD/SPORK

Add the following gems to your gem file:

group :development, :test do
  gem 'jasmine'
  gem 'jasminerice'
  gem 'database_cleaner'
  gem 'capybara'
  gem 'rspec', ">= 2.5.0"
 gem "rspec-rails", ">= 2.5.0"