Skip to content

Instantly share code, notes, and snippets.

@sofadesign
sofadesign / Follow Hyperlink.tmCommand.rb
Created April 16, 2009 07:13
Texmate command: open markdown links
/* Cross browser transparency */
.transparent_class {
filter:alpha(opacity=50);
-moz-opacity:0.5;
-khtml-opacity: 0.5;
opacity: 0.5;
}
@imathis
imathis / SASS opacity mixin
Created July 16, 2009 19:50
Use this SASS mixin to assign cross-browser CSS opacity
// expects a number from 0 to 100
=opacity(!opacity)
:opacity= !opacity / 100
:-moz-opacity= !opacity / 100
:-ms-filter= "progid:DXImageTransform.Microsoft.Alpha(Opacity=#{!opacity})"
:filter= "alpha(opacity=#{!opacity})"
<?php
// LIMONADE SESSION FEATURES EXAMPLES
require_once 'lib/limonade.php';
function configure()
{
// by default, session is enable. It automaticaly start a session with LIM_SESSION_NAME as name
option('session', false); // disable
option('session', true); // enable
<?php
// LIMONADE FLASH FEATURES EXAMPLES
require_once 'lib/limonade.php';
function configure()
{
option('env', ENV_DEVELOPMENT);
}
function before()
<?php
# LIMONADE URL REWRITING EXAMPLE
# In your .htaccess in your app folder
# <IfModule mod_rewrite.c>
# Options +FollowSymlinks
# Options +Indexes
# RewriteEngine on
@jaywilliams
jaywilliams / csv_to_array.php
Created April 30, 2010 23:18
Convert a comma separated file into an associated array.
<?php
/**
* Convert a comma separated file into an associated array.
* The first row should contain the array keys.
*
* Example:
*
* @param string $filename Path to the CSV file
* @param string $delimiter The separator used in the file
* @return array
=clearfix
overflow: hidden
+has-layout
/* clears while allowing overflow (great for use with box shadows)
=pie-clearfix
&:after
content: " "
display: block
height: 0
// Create a simple top to bottom linear gradient with a background-color backup
// The first argument, $color will be output as background-color: $color
//
// This yields a gradient that is 5% brighter on the top and 5% darker on the bottom
//
// +gradient-bg(#777)
//
// This yeilds a gradient where the bright and dark colors are shifted 10% from the original color.
// If you don't specify a third argument it will assign this value for the darkness too, keeping the gradient even.
//
@mikeflynn
mikeflynn / etchosts.sh
Created December 13, 2012 19:04
An /etc/hosts manager bash script (v1.1) -- Added import and export commands!
#!/bin/bash
HOSTSFILE="/etc/hosts"
BAKFILE="$HOSTSFILE.bak"
DOMAINREGEX="^[a-zA-Z0-9]{1}[a-zA-Z0-9\.\-]+$"
IPREGEX="^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$"
URLREGEX="^https?:\/\/[a-zA-Z0-9]{1}[a-zA-Z0-9\/\.\-]+$"
backup()
{