Skip to content

Instantly share code, notes, and snippets.

@musicalbigfoot
musicalbigfoot / gist:6056973
Created July 22, 2013 19:43
CSS: Background Size - Cover
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
@musicalbigfoot
musicalbigfoot / gist:5754533
Created June 11, 2013 04:51
PHP: CSV Migration
<?php
$csv = new CSVFile('export.csv');
$return = Array();
$i = 0;
foreach ($csv as $line)
{
$return[$i] = $line;
$i++;
@musicalbigfoot
musicalbigfoot / MainActivity.java
Created June 9, 2013 00:13
Only inflate view if it doesnt exist
if (rootView != null) {
ViewGroup parent = (ViewGroup) rootView.getParent();
if (parent != null)
parent.removeView(rootView);
}
try {
rootView = inflater.inflate(tabLayout, container, false);
} catch (InflateException e) {
/* view is already there, just return view as it is */
}
@musicalbigfoot
musicalbigfoot / gist:5605976
Created May 18, 2013 22:32
XML: Holo Colors
<resources>
<color name="Tombstone">#4C4C4C</color>
<color name="Charcoal">#3C3C3D</color>
<color name="AlmostBlack">#303030</color>
<color name="BlueLight">#33b5e5</color>
<color name="BlueDark">#0099cc</color>
<color name="BlueBright">#00ddff</color>
<color name="PurpleLight">#AA66CC</color>
@musicalbigfoot
musicalbigfoot / gist:5602951
Created May 18, 2013 01:58
CSS: Rotate Element
transform:rotate(-6deg);
-o-transform:rotate(-6deg);
-ms-transform:rotate(-6deg);
-moz-transform:rotate(-6deg);
-webkit-transform:rotate(-6deg);
/*------------------------------------------------*/
/*-----------------[RESET]------------------------*/
/*------------------------------------------------*/
/* http://meyerweb.com/eric/tools/css/reset/ */
/* v1.0 | 20080212 */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
@musicalbigfoot
musicalbigfoot / gist:4680644
Created January 31, 2013 05:59
JavaScript: jQuery Animate - Basic
thing.animate({
opacity : '0.5',
left : '+=50'
}, 800);
@musicalbigfoot
musicalbigfoot / gist:4667005
Created January 29, 2013 19:37
PHP: NOC2 Employees List
$employees = ORM::factory('user')
->where('type','=','employee')
->and_where('active','=',TRUE)
->find_all();
$locs = ORM::factory('location')
->where('active','=',TRUE)
->order_by('location','asc')
->find_all();
@musicalbigfoot
musicalbigfoot / gist:4637456
Created January 25, 2013 20:14
CSS: Outline Text Shadow
text-shadow: -1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, 1px 1px 0 #000;
@musicalbigfoot
musicalbigfoot / gist:4577366
Created January 20, 2013 08:56
CSS: Transition All
-webkit-transition: all .5s ease-in-out;
-moz-transition: all .5s ease-in-out;
-ms-transition: all .5s ease-in-out;
-o-transition: all .5s ease-in-out;
transition: all .5s ease-in-out;