Skip to content

Instantly share code, notes, and snippets.

@livid
livid / header.html
Created May 10, 2014 11:29
A fix for Jekyll 2 default template on Chrome
<div class="trigger">
{% for page in site.pages %}
{% if page.title %}
<a class="page-link" href="{{ page.url | prepend: site.baseurl }}">{{ page.title }}</a>
{% endif %}
{% endfor %}
</div>
#import <Foundation/Foundation.h>
int foo(int start, int end) {
NSLog(@"Hello");
int result;
int i;
int max = end + 1;
<?php
class LividUtil {
public static function parseUserAgent($ua = '') {
if ($ua == '') {
if (isset($_SERVER['HTTP_USER_AGENT'])) {
$ua = $_SERVER['HTTP_USER_AGENT'];
} else {
if (isset($_SERVER['HTTP_VIA'])) {
if (preg_match('/(infoX)|(Nokia WAP Gateway)|(WAP)/i', $_SERVER['HTTP_VIA'], $z)) {
$o['ua'] = $_SERVER['HTTP_VIA'];