Skip to content

Instantly share code, notes, and snippets.


Gustaf Lindqvist gustaflindqvist

View GitHub Profile
View gist:759677
E:\>setup.exe /ACTION=install /SKIPRULES=PerfMonCounterNotCorr
Microsoft (R) SQL Server 2008 R2 Setup 10.50.1600.01
Copyright (c) Microsoft Corporation. All rights reserved.
gustaflindqvist / gist:999097
Created May 30, 2011
Sinatra Stylesheet Expires
View gist:999097
get "/css/foo.css" do
content_type 'text/css'
response['Expires'] = ( + 60*60*24*356*3).httpdate
gustaflindqvist / gist:1904401
Created Feb 24, 2012
Problem with Homebrew when running upgrade
View gist:1904401
/usr/local/Library/Homebrew/global.rb:43: warning: Insecure world writable dir /usr/local/git/bin in PATH, mode 040777
/usr/local/bin/brew:74: warning: Insecure world writable dir /usr/local/git/bin in PATH, mode 040777
Error: no such file to load -- formula_support
Please report this bug:
/usr/local/Library/Homebrew/formula.rb:3:in `require'
/usr/local/Library/Homebrew/formula_installer.rb:2:in `require'
/usr/local/Library/Homebrew/cmd/install.rb:1:in `require'
View gist:3760397
#if ( $is_signed_in && ($permissionChecker.isOmniadmin() ) )
<script type="text/javascript">
// hack catching exceptions
Liferay = function() {return {};}();
Liferay.Portlet = {
isAjax: function(id) {return true;},
process: function(id) {}
gustaflindqvist / gist:4195333
Created Dec 3, 2012 — forked from digitaljhelms/gist:3014302
Sublime Text 2 bash alias & CLI function to open projects without using the `.sublime-project` file extension
View gist:4195333
# bash alias
alias subl='/Applications/Sublime\ Text\'
# bash function, usage: $ st -p [projectname] -opt2 -opt3
function st() {
if [ -n "$1" -a -n "$2" ]; then # if more than one argument
if [ "$1" = "-p" -o "$1" = "--project" ]; then # if arg1 is -p or --project
local projectfile="$2"
[[ $projectfile != *.sublime-project ]] && projectfile="$2.sublime-project" # detect if arg2 already includes the ext
if [ -e $projectfile ]; then # does project file exist?
View gist:4662838
def check_ldap_user(name)
filter = Net::LDAP::Filter.eq("cn", name)
treebase = "dc=foo, dc=bar" => treebase, :filter => filter, :attributes => attrs,
:return_result => false) do |entry|
entry.each do |attribute, values|
values.each do |value|
View gist:7911017
// prevent submit
// to submit the form again
View gist:8052226

Sublime Text 2 – Useful Shortcuts (Mac OS X)


⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt

Rails Models

Generating models

$ rails g model User


View rvm_apache_passenger.txt
# Install rvm system-wide
bash -s stable < <(curl -s )
# Update the packages
apt-get update
apt-get upgrade
apt-get install build-essential
# get the packages required by ruby
rvm pkg install zlib