Skip to content

Instantly share code, notes, and snippets.

@ganglio
ganglio / boxes.css
Created March 30, 2012 10:22
CSS - Alternative inline blocks
.container {
margin-top: 100px;
text-align: center;
font-size: 0;
}
.box {
background-color: green;
border-radius: 10px 10px 10px 10px;
font-size: 30px;
height: 40px;
@ganglio
ganglio / index.html
Created April 2, 2012 17:37
CSS + HTML - Possible dock implementation
<!DOCTYPE HTML>
<html lang="en-GB">
<head>
<meta charset="UTF-8">
<title>Dock</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<ul>
<li>
@ganglio
ganglio / index.html
Created April 3, 2012 12:53
CSS + HTML - Responsive multicolumn pinterest-like layout
<!DOCTYPE HTML>
<html lang="en-GB">
<head>
<meta charset="UTF-8">
<title>myBoard</title>
<link rel="stylesheet" href="style.css" />
<script type="text/javascript" src="https://raw.github.com/LeaVerou/prefixfree/master/prefixfree.min.js"></script>
<link href='http://fonts.googleapis.com/css?family=Dosis' rel='stylesheet' type='text/css'>
</head>
<body>
<!DOCTYPE HTML>
<html lang="en-GB">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;"/>
<title></title>
</head>
<body>
</body>
@ganglio
ganglio / gist:2768325
Created May 22, 2012 10:57
MySQL Connection
<?php
$host="HOSTNAME";
$username="USERNAME";
$password="PASSWORD";
$database="DATABASE";
if (!($db=mysql_connect($host,$username,$password)))
die("unable to connect:".mysql_error());
if (!mysql_select_db($database,$db))
@ganglio
ganglio / clippath.svg
Created June 26, 2012 16:07 — forked from sawyerh/clippath.svg
SVG Clippath
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ganglio
ganglio / netspark
Created July 2, 2012 22:49
BASH: NetSpark IO Geeklet
#!/usr/bash
INTF=en0
MAXPOINTS=30
echo $1;
if [ "$1" == "RESET" ]; then
defaults write netspark in ""
defaults write netspark out ""
defaults write netspark lastIn 0
defaults write netspark lastOut 0
@ganglio
ganglio / uptime.sh
Created July 3, 2012 19:23
BASH: Revised Uptime Geeklet
#!/bin/bash
then=$(sysctl kern.boottime | awk '{print $5}' | sed "s/,//")
now=$(date +%s)
diff=$(($now-$then))
days=$(($diff/86400));
diff=$(($diff-($days*86400)))
hours=$(($diff/3600))
diff=$(($diff-($hours*3600)))
minutes=$(($diff/60))
@ganglio
ganglio / jquery.plugin-skeleton.js
Created July 11, 2012 12:40
jQuery: Plugin Skeleton
(function($){
$.plugin = $.plugin || {version: "1.0.0"};
$.plugin.defaultConf = {
conf : {
}
};
function Plugin(elem, conf) {
var
@ganglio
ganglio / knob.scss
Created July 11, 2012 15:03
SCSS: Rotating Knob
@mixin knob($size,$color) {
$darkColor: darken($color, 15%);
$shadowColor: darken($darkColor,10%);
$lightColor: lighten($color, 15%);
$knobSize: $size * 0.8;
$dotSize: $size/8;
width:$size;
height:$size;
background-color: rgba(255,0,0,0.1);