Skip to content

Instantly share code, notes, and snippets.

View pgherveou's full-sized avatar

PG Herveou pgherveou

View GitHub Profile
@pgherveou
pgherveou / dabblet.css
Created February 23, 2018 00:51 — forked from anonymous/dabblet.css
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f07;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
@pgherveou
pgherveou / firstDifferenceBetweenStrings.swift
Created September 29, 2016 21:36 — forked from kristopherjohnson/firstDifferenceBetweenStrings.swift
Swift code to find differences between strings and display them in a readable way, useful for displaying unit test results
//: Playground - noun: a place where people can play
import Foundation
/// Find first differing character between two strings
///
/// :param: s1 First String
/// :param: s2 Second String
///
/// :returns: .DifferenceAtIndex(i) or .NoDifference
@pgherveou
pgherveou / dabblet.css
Created June 22, 2012 10:24 — forked from DeviaVir/dabblet.css
Vertical centering with Flexbox + margin fallback
/**
* Vertical centering with Flexbox + margin fallback
* Lea Verou & David Storey
*/
div {
width: 56px; /* needed for FF */
height: 56px;
font-size: 30px;
@pgherveou
pgherveou / dabblet.css
Created June 22, 2012 09:28 — forked from dgmid/dabblet.css
CSS text-shadows - Example 2
/**
* CSS text-shadows - Example 2
*/
/* page styles */
@font-face {
font-family: 'ChunkFiveRegular';
src: url('http://www.midwinter-dg.com/blog_demos/css-text-shadows/fonts/chunkfive-webfont.eot');
src: url('http://www.midwinter-dg.com/blog_demos/css-text-shadows/fonts/chunkfive-webfont.eot?iefix') format('eot'),
@pgherveou
pgherveou / dabblet.css
Created May 18, 2012 21:41 — forked from LeaVerou/dabblet.css
Playing with background-attachment
/**
* Playing with background-attachment
*/
pre {
max-height: 150px;
border: 1px solid silver;
overflow: auto;
background: url('http://placekitten.com/200/200');
color: white;
@pgherveou
pgherveou / dabblet.css
Created May 18, 2012 17:56 — forked from LeaVerou/dabblet.css
Scrolling shadows by @kizmarh and @LeaVerou
/**
* Scrolling shadows by @kizmarh and @leaverou
* Only works in browsers supporting background-attachment: local; & CSS gradients
* Degrades gracefully
*/
html {
background: white;
font: 120% sans-serif;
}
@pgherveou
pgherveou / iptables.rules
Created April 24, 2012 22:32 — forked from logicalparadox/iptables.rules
Getting Node.js process to run on port 80 without sudo
# NAT interface routing
*nat
# Setup
:PREROUTING ACCEPT [0:0]
:INPUT ACCEPT [2:128]
:OUTPUT ACCEPT [2:120]
:POSTROUTING ACCEPT [2:120]
# Redirect port 80 to port 8080
@pgherveou
pgherveou / script.md
Created April 24, 2012 22:32 — forked from torgeir/install_redis_on_ubuntu.md
Redis 2.4.8 Install on Ubuntu 10.04

Installation commands:

$ wget http://redis.googlecode.com/files/redis-2.4.8.tar.gz
$ tar xvfz redis-2.4.8.tar.gz 
$ cd redis-2.4.8/
$ mkdir -p /opt/redis
$ make PREFIX=/opt/redis install
$ cp redis.conf /opt/redis/redis.conf
$ chown -R redis:redis /opt/redis
@pgherveou
pgherveou / iptables.rules
Created April 24, 2012 21:01 — forked from logicalparadox/iptables.rules
Getting Node.js process to run on port 80 without sudo
# NAT interface routing
*nat
# Setup
:PREROUTING ACCEPT [0:0]
:INPUT ACCEPT [2:128]
:OUTPUT ACCEPT [2:120]
:POSTROUTING ACCEPT [2:120]
# Redirect port 80 to port 8080
@pgherveou
pgherveou / dabblet.css
Created April 22, 2012 09:06 — forked from kizu/dabblet.css
Scrolling shadows by @kizmarh
/* Scrolling shadows by @kizmarh */
html {
background: #FFF;
}
.scrollbox {
position: relative;
z-index: 1;