Skip to content

Instantly share code, notes, and snippets.

View AndreasStokholm's full-sized avatar

Andreas Stokholm AndreasStokholm

View GitHub Profile
@AndreasStokholm
AndreasStokholm / Get Google rank
Created October 26, 2011 21:16
Add a custom variable to your google analytics data with the rank of the result leading into your page.
if (document.referrer != undefined) {
var rank = 0;
var array = document.referrer.split('&');
for (value in array) {
if (array[value].indexOf('cd') != -1) {
rank = array[value].replace('cd=', '');
}
}
if (rank > 0) {
_gaq.push([
@AndreasStokholm
AndreasStokholm / gist:1924150
Created February 27, 2012 14:22
Overlay box
#newsletter-box-back {
width:100%;
height:100%;
position:absolute;
top:0;
left:0;
z-index:10;
background:#000;
opacity:0.75;
filter:alpha(opacity=75);
@AndreasStokholm
AndreasStokholm / README.md
Created September 24, 2012 21:00 — forked from aronwoost/README.md
Auto-deploy with php and github on an Ubuntu Amazon EC2 box

##Auto-deploy with php and github on an Ubuntu Amazon EC2 box

Fork from other gist Build auto-deploy with php and git(hub) on an EC2 AMAZON AMI instance - Covers a basic Ubuntu isntall

When ever it says www-data below, it's the user Apache runs under. So if your apache user is called something else, change it to that.

##Install git

sudo aptitude install git-core

Keybase proof

I hereby claim:

  • I am andreasstokholm on github.
  • I am stokholm (https://keybase.io/stokholm) on keybase.
  • I have a public key whose fingerprint is 6B2A CEB5 B373 98B6 DFA5 2EE5 ABC3 984E 4425 96A8

To claim this, I am signing this object:

<?php
public function Preview(Request $request)
{
$inputs = $request->all();
$invoiceItems = array_map(function ($quantity, $description, $price) {
return [
'quantity' => $quantity,
'description' => $description,
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
.ExternalClass,
.ExternalClass p,
.ExternalClass span,
@AndreasStokholm
AndreasStokholm / UIS.sh
Last active December 1, 2017 07:51 — forked from anonymous/UIS.sh
#!/bin/bash
# Update all repos
apt-get update
# Install some default software we need to install the rest
apt-get install -y apt-transport-https
# Add all repos I want to install
# Krita