Skip to content

Instantly share code, notes, and snippets.

View leifg's full-sized avatar
🏄‍♂️

Leif Gensert leifg

🏄‍♂️
View GitHub Profile
run:
rbenv install ./2.2.2-railsexpress
or edit install.sh to include the RUBY_VERSION you want to install and run the script.
@brenopolanski
brenopolanski / merge-pdf-ghostscript.md
Last active April 3, 2024 10:03
Merge multiple PDFs using Ghostscript

A simple Ghostscript command to merge two PDFs in a single file is shown below:

gs -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=combine.pdf -dBATCH 1.pdf 2.pdf

Install Ghostscript:

Type the command sudo apt-get install ghostscript to download and install the ghostscript package and all of the packages it depends on.

@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active March 27, 2024 06:36
A badass list of frontend development resources I collected over time.
@bugwelle
bugwelle / angularjs-i18next-directive.js
Last active December 15, 2015 09:39
This is a simple directive for AngularJS to use i18next.
/*
*
* There is now an Angular directive, filter and provider!
* It can be found here: https://github.com/i18next/ng-i18next
* ng-i18next is now part of the i18next rganization!
*
*/
/*
* AngularJS directive for using i18next (http://jamuhl.github.com/i18next)
@roolo
roolo / rmagick-fix.sh
Created February 6, 2013 12:16
Fixing the "Can't install RMagick 2.13.1. Can't find the ImageMagick library or one of the dependent libraries. Check the mkmf.log file for more detailed information."@Mac w/ homebrew – taken from http://blog.kenleycheung.com/2012/12/rmagick-homebre/
brew uninstall imagemagick
cd /usr/local/Cellar
git checkout 834ce4a /usr/local/Library/Formula/imagemagick.rb
brew install imagemagick
@nikolaifedorov
nikolaifedorov / sample_ruby_webserver.rb
Created November 22, 2012 10:50 — forked from dcparker/sample_ruby_webserver.rb
Mini Ruby web server example!
require 'socket'
socket = TCPServer.new('0.0.0.0', '8080')
socket.setsockopt(Socket::SOL_SOCKET, Socket::SO_REUSEADDR, 1)
loop do
client = socket.accept
data = ''
loop do
event = select([client],nil,nil,0.5)
if client.eof? # Socket's been closed by the client
@ctgswallow
ctgswallow / gist:3409231
Created August 20, 2012 23:27
Create a template within a ruby block
ruby_block "create ssh key" do
block do
k = SSHKey.generate(:type => 'RSA', :bits => 1024, :comment => "Postgres Master")
node.set[:postgresql][:pubkey] = k.ssh_public_key
node.save
# Much of the DSL disappears in ruby blocks. Here's how to create a template.
rc = Chef::RunContext.new(node, node.cookbook_collection)
t = Chef::Resource::Template.new "/var/lib/postgresql/.ssh/id_rsa"
t.source("id_rsa.erb")
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@henrik
henrik / ocr.markdown
Created March 3, 2012 17:07
OCR on OS X with tesseract

Install ImageMagick for image conversion:

brew install imagemagick

Install tesseract for OCR:

brew install tesseract --all-languages

Or install without --all-languages and install them manually as needed.

@burke
burke / 0-readme.md
Created January 27, 2012 13:44 — forked from funny-falcon/cumulative_performance.patch
ruby-1.9.3-p327 cumulative performance patch for rbenv

ruby-1.9.3-p327 cumulative performance patch for rbenv

This installs a patched ruby 1.9.3-p327 with various performance improvements and a backported COW-friendly GC, all courtesy of funny-falcon.

Requirements

You will also need a C Compiler. If you're on Linux, you probably already have one or know how to install one. On OS X, you should install XCode, and brew install autoconf using homebrew.