This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[role=navigation] { | |
margin-bottom: 1px; | |
} | |
[role=main] > div { | |
background-color: white; | |
border-left: 1px solid #d1d1d1; | |
border-right: 1px solid #d1d1d1; | |
box-sizing: border-box; | |
margin: 0 auto; | |
padding: 1em; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 3ec96e871d2e561faeef82524ed91bb98698f6a1 Mon Sep 17 00:00:00 2001 | |
From: Joakim Hedlund | |
Date: Thu, 12 Jun 2014 18:44:52 +0200 | |
Subject: [PATCH] Parse and tuck away minimap colors | |
--- | |
app/libraries/POT/OTS_ItemsList.php | 68 ++++++++++++++++++++++++++++++++----- | |
1 file changed, 59 insertions(+), 9 deletions(-) | |
diff --git a/app/libraries/POT/OTS_ItemsList.php b/app/libraries/POT/OTS_ItemsList.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Helper function to reformat arrays. | |
* @see https://gist.github.com/Sleavely/2c1aa7ba13da80dfeb43 | |
* | |
* @param array $source | |
* The multidimensional array where each input field is an array | |
* @param array $arrays | |
* A list of which keys to include in the output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$errand = foo(); | |
$order = bar(); | |
// Email the customer a receipt | |
$mail = Mail::send('returns.emails.approved', array('data' => 'to', 'the' => 'view'), function($message) use ($errand, $order) | |
{ | |
// The "use" keyword allows us to access external variables in our anonymous function | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
cd ~/www/magento | |
# Pull main repo | |
git pull --no-edit origin master | |
# Update submodules | |
git submodule update --recursive | |
git submodule update --init --recursive |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
Requires jQuery. | |
Built, with love, by Joakim Hedlund <joakim.hedlund@klarna.com> | |
*/ | |
jQuery.fn.lastLineWidth = function(text){ | |
var $this = jQuery(this), | |
$tmpHtml = jQuery('<span style="postion:absolute;width:auto;left:-9999px"></span>'); | |
var containerWidth = $this.width(), //width of the container (e.g. <h1>) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]--> | |
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]--> | |
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]--> | |
<!--[if gt IE 8]><!--> <html class="no-js" lang="sv-SE"> <!--<![endif]--> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
<meta name="viewport" content="width=device-width"> | |
<title>Zoomable OTMap</title> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]--> | |
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]--> | |
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]--> | |
<!--[if gt IE 8]><!--> <html class="no-js" lang="sv-SE"> <!--<![endif]--> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
<meta name="viewport" content="width=device-width"> | |
<title>Klarna dynamic logos</title> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(".my-awesome-link-class").one('click', function(event){ | |
var $this = jQuery(this); | |
//no need to delay when the link opens in a new window | |
if (!$this.attr("target") && !event.ctrlKey && !event.shiftKey && !event.metaKey) { | |
event.preventDefault(); | |
var newHref = this.href; | |
//the below is pseudo-code | |
jQuery.ajax({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function validatePNumber($pnumber) { | |
// reference: http://en.wikipedia.org/wiki/National_identification_number#Finland | |
//initial format thingy | |
$pnumber = strtoupper($pnumber); | |
if(!preg_match('/^([0-9]{6})(\-|\+|A)?([0-9]{3})([0-9A-Y])$/', $pnumber, $matches)) return false; | |
//loop through each character of $matches[1].$matches[3] and sum them up |
OlderNewer