Skip to content

Instantly share code, notes, and snippets.

View EvanLovely's full-sized avatar

Evan Lovely EvanLovely

View GitHub Profile
@EvanLovely
EvanLovely / index-targetting.css
Created October 23, 2011 11:36
Targeting specific numbered elements with CSS
/* Works in IE7+ */
ul li:first-child + li + li {
}/* Targets the 3rd list item */
@EvanLovely
EvanLovely / dabblet.css
Created December 23, 2011 09:23
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
html {
background: rgb(1,65,244);
background: linear-gradient(81deg, #f27, yellow);
min-height:100%;
}
p {
font-size:42px;
@EvanLovely
EvanLovely / Asset.js
Created March 16, 2012 22:24
Placeholder IE7 Script
$('[placeholder]').focus(function() {
var input = $(this);
if (input.val() == input.attr('placeholder')) {
input.val('');
input.removeClass('placeholder');
}
}).blur(function() {
var input = $(this);
if (input.val() == '' || input.val() == input.attr('placeholder')) {
input.addClass('placeholder');
@EvanLovely
EvanLovely / iPad-Orientation-Change.js
Created August 13, 2012 23:01
reset scaling on iPads on orientation change
// reset scaling on iPads on orientation change. author: @axolx
if (navigator.userAgent.match(/iPad/i)) {
$(window).bind('orientationchange', function(event) {
if (window.orientation == 90 || window.orientation == -90 || window.orientation == 270) {
$('meta[name="viewport"]').attr('content', 'height=device-width,width=device-height,initial-scale=1.0,maximum-scale=1.0');
$(window).resize();
} else {
$('meta[name="viewport"]').attr('content', 'height=device-height,width=device-width,initial-scale=0.8,maximum-scale=0.8');
$(window).resize();
}
@EvanLovely
EvanLovely / iPhone-orientation-change.js
Created August 13, 2012 23:04
reset scaling on iPhones on orientation change
// reset scaling on iPhones on orientation change. author: @axolx
if (navigator.userAgent.match(/iPhone/i)) {
$(window).bind('orientationchange', function(event) {
$('meta[name="viewport"]').attr('content', 'width=device-width,initial-scale=1.0,maximum-scale=1.0, minimum-scale=1.0');
$(window).resize();
}).trigger('orientationchange');
}
@EvanLovely
EvanLovely / dabblet.css
Created October 12, 2012 22:06
Awesome CSS Triangle
/**
* Awesome CSS Triangle
*/
.triangle {
width: 0;
height: 0;
border-width: 10px 10px 10px 19px;
border-style: solid;
border-color: transparent transparent transparent blue;
@EvanLovely
EvanLovely / applescript:_command-tab
Created July 31, 2013 00:03
Applescript: Command Tab
tell application "System Events"
key down command
keystroke tab
key up command
end tell
@EvanLovely
EvanLovely / applescript_command-tab
Last active October 29, 2021 23:17
Applescript: Command Tab
tell application "System Events"
key down command
keystroke tab
key up command
end tell
@EvanLovely
EvanLovely / checkboxes
Created August 3, 2013 00:19
Fancy CSS3 Checkboxes (for Drupal Markup)
.form-type-checkbox {
padding-left: 18px;
padding-right: 2px;
position: relative;
>input {
position: absolute;
left: 0;
top: 4px;
top: 0\9;
@EvanLovely
EvanLovely / index.html
Created August 8, 2013 17:42
A CodePen by Evan Lovely. Custom Checkbox & Radio Form Elements - Making the checkbox & radio look spiffy with CSS3 :)
<input type="checkbox"><br />
<input type="checkbox" checked="true">
<hr />
<input type="radio" name="radio"><br />
<input type="radio" name="radio" checked="true>