Skip to content

Instantly share code, notes, and snippets.

Avatar
☀️
Enjoying SoCal "Fall"

Jimmy Wilson jimmynotjim

☀️
Enjoying SoCal "Fall"
View GitHub Profile
View dabblet.css
/**
* 3D cube
*/
body {
perspective: 99999px;
}
body > section {
display: inline-block;
@soffes
soffes / perferences.json
Created Aug 22, 2012
My Sublime Text 2 config
View perferences.json
{
"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 Sep 19, 2012
HTML lang attribute / ISO language code reference / Culture names
View html-languages.txt
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 Dec 4, 2020 — forked from webinista/has3d.js
Testing for CSS 3D Transforms Support
View has3d.js
function has3d(){
if (!window.getComputedStyle) {
return false;
}
var el = document.createElement('p'),
has3d,
transforms = {
'webkitTransform':'-webkit-transform',
'OTransform':'-o-transform',
View fn-post-custom-fields-infographic.php
<?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 Oct 10, 2012
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
View inc-state-abbreviations.php
<?php
switch ($map_state)
{
case 'Alabama':
$abbr = 'AL';
break;
case 'Alaska':
$abbr = 'AK';
break;
View _media_queries.sass
// 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 Oct 23, 2012
PHP Function to check Android version from the user agent.
View is-old-android.php
/**
* 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 Jul 4, 2017
Custom Meta Box to Toggle Monetization
View fn-page-custom-fields-monetization.php
<?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 Oct 26, 2012
Get Vimeo 1280px poster image
View vimeo_largest_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;