Skip to content

Instantly share code, notes, and snippets.

View lpil's full-sized avatar
🦦
Ahoy! Have a fab time!

Louis Pilfold lpil

🦦
Ahoy! Have a fab time!
View GitHub Profile
@lpil
lpil / gist:9444180
Last active August 29, 2015 13:57
.bashrc
# Coloured man pages
man() {
env LESS_TERMCAP_mb=$'\E[01;31m' \
LESS_TERMCAP_md=$'\E[01;38;5;74m' \
LESS_TERMCAP_me=$'\E[0m' \
LESS_TERMCAP_se=$'\E[0m' \
LESS_TERMCAP_so=$'\E[38;5;246m' \
LESS_TERMCAP_ue=$'\E[0m' \
LESS_TERMCAP_us=$'\E[04;38;5;146m' \
man "$@"

1. Who are you, and what do you do?

Hi Steven! I'm Louis Pilfold, I work for a London print/soft-as-a-service company doing web dev, site administration, automation, that kind of thing. I'm also a music lover who DJs electronic music with a Linux computer and a pair of turntables.

2. Why do you use Linux?

Countless reasons- I'm quite the Linux fanatic. The biggest one for me is

#!/usr/bin/env ruby
# Jekyll sync and rebuild sites in subdirs
path = Dir.pwd
Dir.glob('*/').each do |website_dir|
Dir.chdir path + '/' + website_dir
puts "\e[32m#{Dir.pwd}\e[0m"
output = `git pull`
@lpil
lpil / print_jekyll_subdir_urls.rb
Last active August 29, 2015 14:06
Generate a list of URLs used by each jekyll site subdirectory of cwd
#!/usr/bin/env ruby
# encoding: utf-8
# Generate a list of URLs used by each jekyll site subdirectory of cwd
template = <<-END
---
layout: none
---
/*

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23/12/2008
  • Revised date: 15/12/2013
  • Original post

hjdivad commented 3 days ago

@lpil the way I do this for my own snippets is to invent my own file types for libraries and then have a project local vimrc that sets those filetypes.

For example, if I have a ruby project using the rspec library my project-local vimrc might contain something like

augroup ExtraTypes
  autocmd!
  autocmd BufNewFile,BufRead *_spec.rb set ft+=.rspec

augroup end

@lpil
lpil / routes.rake
Last active August 29, 2015 14:19 — forked from oivoodoo/routes.rake
namespace :grape do
desc 'Print compiled grape routes'
task :routes => :environment do
API.routes.each do |route|
puts route
end
end
end
@lpil
lpil / cvimrc
Created August 8, 2015 16:25
cvimrc
let blacklists = ["http://localhost/*"]
let scrollduration = 10
set numerichints
set typelinkhints
@lpil
lpil / gittruncatehistory.sh
Last active September 11, 2015 17:01 — forked from magnetikonline/gittruncatehistory.sh
Truncate Git history to a specific SHA1, dropping everything before it.
#!/bin/bash -e
# Lifted from: https://github.com/adrienthebo/git-tools/blob/master/git-truncate
# Note: seem to be finding the need to run this twice over to commit the truncate
if [[ (-z $1) || (-z $2) ]]; then
echo "Usage: $(basename $0) <drop before SHA1 commit> <branch>"
exit 1
fi
git filter-branch --parent-filter "sed -e 's/-p $1[0-9a-f]*//'" \
@lpil
lpil / nginxproxy.md
Created September 24, 2015 10:40 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers