Skip to content

Instantly share code, notes, and snippets.

View jalbertbowden's full-sized avatar

albert jalbertbowden

View GitHub Profile
@jalbertbowden
jalbertbowden / @page media print style sheet
Last active December 15, 2015 12:38 — forked from drublic/dabblet.css
Named Pages - Print style sheets
/** http://dabblet.com/gist/5261343
* Named Pages - Print style sheets
*/
@page narrow {
size: 9cm 18cm;
}
@page rotated {
size: landscape;
}
<?php
/**
* On-the-fly CSS Compression
* Copyright (c) 2009 and onwards, Manas Tungare.
* Creative Commons Attribution, Share-Alike.
*
* In order to minimize the number and size of HTTP requests for CSS content,
* this script combines multiple CSS files into a single file and compresses
* it on-the-fly.
*
@jalbertbowden
jalbertbowden / round-icon-circular-menu.css
Last active November 9, 2017 06:47
Position round icons into circle menu (StackOverflow) via thebabydino http://dabblet.com/gist/3864650
/**
* Position icons into circle (SO)
* http://stackoverflow.com/q/12813573/1397351
*/
.circle-container {
position: relative;
width: 24em;
height: 24em;
padding: 2.8em; /*= 2em * 1.4 (2em = half the width of an img, 1.4 = sqrt(2))*/
border: dashed 1px;
@-webkit-keyframes rainbow {
0% {border-color: hsl(0, 100%, 50%);}
100% {border-color: hsl(255, 100%, 50%);}
}
.rainbow_border{
border: 4px solid hsl(0, 100%, 50%);
-webkit-animation: rainbow 5s infinite alternate;
}
function convert(geo){
var latlonrg = /(\d+(?:\.\d+)?)[\xb0\s]?\s*(?:(\d+(?:\.\d+)?)['\u2019\u2032\s])?\s*(?:(\d+(?:\.\d+)?)["\u201d\u2033\s])?\s*([SNEW])?/i;
var m = String(geo).split(latlonrg),
lat = m && +m[1] + (m[2] || 0) / 60 + (m[3] || 0) / 3600;
if (m[4].toUpperCase() == "S") {
lat = -lat;
}
<?php
//get artist photo
function getArtistPhoto($artist, $size) {
$artist = urlencode($artist);
$xml = "http://ws.audioscrobbler.com/2.0/?method=artist.getinfo&artist={$artist}&api_key=YOUR_KEY";
$xml = @file_get_contents($xml);
if(!$xml) {
//cleanup and sort elemets that have likes
//cleanup for likes
$(".LikesCount").each(function() {
var num = Number($(this).text().trim().replace("likes", "").replace("like", ""));
$(this).html(num);
});
//sort
var mylist = $('.pin');
//cleanup and sort elemets that have repins
//grab all pins
var mylist = $('.pin');
//find all pins that have repins
var listitems = mylist.find('.RepinsCount');
//trim the contents of the repins element to just a number and compare them against each other to sort
listitems.sort(function(a, b) {
var compA = Number( $(a).text().trim().replace("repins", "").replace("repin", "") );
var compB = Number( $(b).text().trim().replace("repins", "").replace("repin", "") );
<?php
/**
* Template Name: Google+ Feed
*/
/**
* A WordPress page template for a Google+ feed.
*
* @author Dominik Schilling
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>=5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}