Skip to content

Instantly share code, notes, and snippets.

View jimmynotjim's full-sized avatar
☀️
Enjoying SoCal "Fall"

Jimmy Wilson jimmynotjim

☀️
Enjoying SoCal "Fall"
View GitHub Profile
@LeaVerou
LeaVerou / dabblet.css
Created August 7, 2012 19:52
3D cube
/**
* 3D cube
*/
body {
perspective: 99999px;
}
body > section {
display: inline-block;
@soffes
soffes / perferences.json
Created August 22, 2012 05:35
My Sublime Text 2 config
{
"bold_folder_labels": true,
"color_scheme": "Packages/User/Espresso Soda.tmTheme",
"ensure_newline_at_eof_on_save": true,
"file_exclude_patterns":
[
".DS_Store",
".gitkeep",
"dump.rdb"
],
@JamieMason
JamieMason / html-languages.txt
Created September 19, 2012 08:50
HTML lang attribute / ISO language code reference / Culture names
CULTURE SPEC.CULTURE ENGLISH NAME
--------------------------------------------------------------
Invariant Language (Invariant Country)
af af-ZA Afrikaans
af-ZA af-ZA Afrikaans (South Africa)
ar ar-SA Arabic
ar-AE ar-AE Arabic (U.A.E.)
ar-BH ar-BH Arabic (Bahrain)
ar-DZ ar-DZ Arabic (Algeria)
ar-EG ar-EG Arabic (Egypt)
@lorenzopolidori
lorenzopolidori / has3d.js
Last active December 4, 2020 10:52 — forked from webinista/has3d.js
Testing for CSS 3D Transforms Support
function has3d(){
if (!window.getComputedStyle) {
return false;
}
var el = document.createElement('p'),
has3d,
transforms = {
'webkitTransform':'-webkit-transform',
'OTransform':'-o-transform',
@germanny
germanny / fn-post-custom-fields-infographic.php
Created October 3, 2012 14:21
Infographic standard form
<?php
$ig_post_custom_fields = array (
"infographic" => array(
"name" => "is_infographic",
"std" => "",
"title" => "Is this an infographic post?",
"description" => "If you check this box, we'll add a Pin It share option.",
"type" => "checkbox"),
"image_url" => array(
@germanny
germanny / inc-state-abbreviations.php
Created October 10, 2012 22:41
Responsive States Map. Includes states listing with abbreviations and AI file of the map. Uses both http://archive.plugins.jquery.com/project/maphilight and https://github.com/stowball/jQuery-rwdImageMaps. Requires the latest version of jQuery or you'll b
<?php
switch ($map_state)
{
case 'Alabama':
$abbr = 'AL';
break;
case 'Alaska':
$abbr = 'AK';
break;
@poteto
poteto / _media_queries.sass
Created October 22, 2012 13:54
Sass media queries
// Standard device screen widths
$iphone-portrait: 320px
$iphone-landscape: 480px
$ipad-portrait: 767px
$ipad-landscape: 980px
$desktop: 1224px
$desktop-large: 1824px
// General device targeting
// Use: Only use if you want the style to apply to many devices
@Abban
Abban / is-old-android.php
Created October 23, 2012 16:09
PHP Function to check Android version from the user agent.
/**
* Is Old Android
*
* Check to see it the user agent is Android and if so then
* check the version number to see if it is lower than 4.0.0
* or passed parameter
*
* @param string $version
* @return boolean
*/
@germanny
germanny / fn-page-custom-fields-monetization.php
Last active July 4, 2017 01:46
Custom Meta Box to Toggle Monetization
<?php // https://gist.github.com/3950382
function toggle_monetization() {
global $post;
$custom = get_post_custom($post->ID);
if(isset($custom["toggle_monetization"][0])) {
$money = $custom["toggle_monetization"][0];
}
?>
<p style="margin-bottom:10px;">
@germanny
germanny / vimeo_largest_image
Created October 26, 2012 22:38
Get Vimeo 1280px poster image
// Vimeo serves up poster images in 100, 200 and 640. But there's also size they don't serve: 1280
// https://developer.vimeo.com/apis/simple
$vimeo_value = get_post_meta($post->ID, 'vimeo_value', TRUE);
$vimeo_video_id = substr($vimeo_value, strrpos($vimeo_value, '/')+1); // get just the id
$vimeo_xml_file = unserialize(file_get_contents("http://vimeo.com/api/v2/video/$vimeo_video_id.php")); // get the video data from the API
$vimeo_video_width = $vimeo_xml_file[0]['width'];
$vimeo_thumbnail_large = $vimeo_xml_file[0]['thumbnail_large']; // load up one of the image sizes
if($vimeo_video_width < 1280) {
$vimeo_thumbnail = $vimeo_thumbnail_large;