Skip to content

Instantly share code, notes, and snippets.

View reinink's full-sized avatar

Jonathan Reinink reinink

View GitHub Profile
@reinink
reinink / gist:11162546
Created April 22, 2014 01:36
Installing wkhtmltopdf on Ubuntu Server 12.10
apt-get install wkhtmltopdf
apt-get install xvfb
echo 'xvfb-run --server-args="-screen 0, 1024x768x24" /usr/bin/wkhtmltopdf $*' > /usr/bin/wkhtmltopdf.sh
chmod a+x /usr/bin/wkhtmltopdf.sh
ln -s /usr/bin/wkhtmltopdf.sh /usr/local/bin/wkhtmltopdf
wkhtmltopdf http://www.google.com output.pdf
@reinink
reinink / phantomjs.sh
Created May 15, 2014 18:02
How to install PhantomJS
# Go to home folder
cd ~
# Download file
wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.7-linux-x86_64.tar.bz2
# Extract
tar -xvf phantomjs-1.9.7-linux-x86_64.tar.bz2
# Copy phantomjs to bin folder
@reinink
reinink / .env
Last active August 29, 2015 14:14
Add environment var config to Laravel 4
APP_ENV=local
APP_DEBUG=true
@reinink
reinink / gist:1472117
Created December 13, 2011 13:22
Make mobile browsers display websites at their native resolution
<meta name="viewport" content="width=device-width, initial-scale=1.0">
@reinink
reinink / index.html
Last active September 29, 2015 05:48
Base HTML5 document.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="style.css">
</head>
<body>
@reinink
reinink / gist:1680575
Created January 26, 2012 02:29
Typical .htaccess index.php rewrite
# Route all requests through index.php
<IfModule mod_rewrite.c>
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
@reinink
reinink / gist:1683466
Created January 26, 2012 15:58
Remove yellow background caused by Google Chrome autocomplete
if (navigator.userAgent.toLowerCase().indexOf("chrome") >= 0)
{
$(window).load(function()
{
setTimeout(function()
{
$('input:-webkit-autofill').each(function()
{
var text = $(this).val();
var name = $(this).attr('name');
@reinink
reinink / search_and_replace.sql
Created April 23, 2012 16:09
Search and replace within a MySQL database
UPDATE TableName set FieldName = replace(FieldName, 'find string', 'replace string')
@reinink
reinink / gist:5032223
Last active December 14, 2015 04:59
JavaScript that will load the PhotoSwipe library for mobile (touch) users, and the Fancybox library for desktop users. This requires yepnope.js (which is bundled with Modernizr).
yepnope(
{
test: Modernizr.touch,
yep: ['/photoswipe/klass.js', '/photoswipe/photoswipe.js', '/photoswipe/photoswipe.css'],
nope: ['/fancybox/jquery.fancybox.js', '/fancybox/jquery.fancybox.css'],
complete: function()
{
var selector = $('.image_link');
if (Modernizr.touch)
@reinink
reinink / provisioning.sh
Last active December 20, 2015 13:39
Generate self signed SSL certificate
# Generate self signed SSL certificate
mkdir /etc/nginx/ssl-certificates
openssl req -batch -new -x509 -days 365 -nodes -out /etc/nginx/ssl-certificates/self-signed.pem -keyout /etc/nginx/ssl-certificates/self-signed.key