Skip to content

Instantly share code, notes, and snippets.

View jalbertbowden's full-sized avatar

albert jalbertbowden

View GitHub Profile
@jalbertbowden
jalbertbowden / index.html
Created April 12, 2013 06:56
A CodePen by Peter Westendorp. Tunnel vision 3D CSS - Tunnel vision effect made with just some CSS 3D transforms, border-radius and border-style. Not really useful, it just looks nice...
<div class="scene">
<div class="wrapper">
<ul class="tunnel">
<li class="ring"></li>
<li class="ring"></li>
<li class="ring"></li>
<li class="ring"></li>
<li class="ring"></li>
<li class="ring"></li>
<li class="ring"></li>
@-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;
}
@jalbertbowden
jalbertbowden / detect-opera-mini.js
Created April 12, 2013 22:20
Detecting Opera Mini using the window.operamini property via http://dev.opera.com/articles/view/opera-mini-and-javascript/#detectingmini Opera Mini also includes an operamini object as a property of the window object. To check for the presence of this object, use the following code.
var isOperaMini = Object.prototype.toString.call(window.operamini) === "[object OperaMini]"
@jalbertbowden
jalbertbowden / target-any-element-with-any-attribute.css
Created April 12, 2013 23:20
In CSS you can target an element with a specific attribute, regardless of what that attribute contains. via http://inspectelement.com/snippets/target-any-element-containing-a-css-class/
p[class]{}
@jalbertbowden
jalbertbowden / mapbox.js
Created April 17, 2013 06:58
Geo for Google Docs - TileMill’s geocoding script - paste this into a Google Doc under Tools -> Script Editor. Change name to "Geo". Save. Back to your Doc, Geo is now an option next to Help. Select Column (including title) to geocode. Click Geo -> Geocode Addresses. Select MapQuest (API doesn't need key). Click geocode. Boom. Instructions from h…
// https://raw.github.com/mapbox/geo-googledocs/master/MapBox.js
// Global variables
var ss = SpreadsheetApp.getActiveSpreadsheet(),
sheet = ss.getActiveSheet(),
activeRange = ss.getActiveRange(),
settings = {};
var geocoders = {
yahoo: {
query: function(query, key) {
@jalbertbowden
jalbertbowden / rachael-foundation.css
Created April 18, 2013 21:27
foundation.css by the one and only https://github.com/morewry most likely don't need it all as it's specific to the site its for, but the normalizations are clean and the foundation is solid
/** http://www.virtualrevolution.net/zbin/rmx-collection-all.css **/
@charset "UTF-8";
/*
## Reset
Minimalized resets that provide a foundation for normalizations & defaults
*/
html, body, h1, h2, h3, h4, h5, h6, p, blockquote, ol, ul, dl, li, dd, pre,
fieldset, form, legend, input, select, textarea, button,
@jalbertbowden
jalbertbowden / index.haml
Created April 19, 2013 06:07
"This is the Factory that makes the CSS" CSS Factory - Pure CSS - Animating pseudo-elements and stuff.. - codpen via Noel Delgado.
.stage
%ul
- 5.times do
%li
.band
.factory
.magic
.screen
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');