Skip to content

Instantly share code, notes, and snippets.

@ashblue
ashblue / twentyeleven-shiv.php
Created August 18, 2011 15:48
WordPress TwentyEleven Child Theme Shiv
<?php
/*
Title: TwentyEleven Child Theme Shiv
Version: .02
Author: Ash Blue
Author URL: http://www.blueashes.com
Repository URL: https://gist.github.com/gists/1154369/
*/
@lucasfais
lucasfais / gist:1207002
Created September 9, 2011 18:46
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@jfountain
jfountain / gist:1640535
Created January 19, 2012 15:13 — forked from lucasfais/gist:1207002
Sublime Text 2 - Raw Shortcuts
super+shift+n new window
super+shift+w close window
super+o prompt open file
super+shift+t reopen last file
super+alt+up switch file
super+n new file
super+s save
super+shift+s prompt save as
super+alt+s save all
super+w close
@marcedwards
marcedwards / high-dpi-media.css
Last active March 2, 2025 20:24
A CSS media query that captures almost all high DPI aware devices.
/* ---------------------------------------------------------- */
/* */
/* A media query that captures: */
/* */
/* - Retina iOS devices */
/* - Retina Macs running Safari */
/* - High DPI Windows PCs running IE 8 and above */
/* - Low DPI Windows PCs running IE, zoomed in */
/* - Low DPI Windows PCs and Macs running Firefox, zoomed in */
/* - Android hdpi devices and above */
@media only screen and (min-width: 320px) {
/* Small screen, non-retina */
}
@media
only screen and (-webkit-min-device-pixel-ratio: 2) and (min-width: 320px),
only screen and ( min--moz-device-pixel-ratio: 2) and (min-width: 320px),
only screen and ( -o-min-device-pixel-ratio: 2/1) and (min-width: 320px),
cd ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/
git clone git://github.com/wbond/sublime_package_control.git Package\ Control
cd Package\ Control
git checkout python3
# restart Sublime Text 3 and you should have Package Control working
@iso100
iso100 / .htaccess
Created May 4, 2013 18:04
Remove trailing slash from URLs
# Remove Trailing Slash
# ------------------------------
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} (.*)$
RewriteRule ^(.+)/$ http://www.yourdomain.com/$1 [R=301,NC,L]
{{ if where }}
<div class="map" id="contact-map"></div>
<style scoped>
.map {height: 300px; width: 100%; max-width: 500px;}
</style>
<script type="text/javascript">
try{_location_maps.length;}catch(e){var _location_maps={};}
_location_maps["contact-map"] = {markers: [{'latitude': '{{ where:latitude }}','longitude':'{{ where:longitude }}','marker_content':'<h2>{{ where:name }}<\/h2>'}],clusters: true,spiderfy_on_max_zoom: true,show_coverage_on_hover: true,zoom_to_bounds_on_click: true,single_marker_mode: false,animate_adding_markers: true,disable_clustering_at_zoom: 15,max_cluster_radius: 80,starting_latitude: {{ where:latitude }},starting_longitude: {{ where:longitude }},starting_zoom: 15};
</script>
{{ location:start_maps }}
@razwan
razwan / _baseline.scss
Created April 14, 2014 16:20
Aligning type to baseline the right way with SASS
$base-font-size: 16px;
$base-line-height: 1.5;
// this value may vary for each font
// unitless value relative to 1em
$cap-height: 0.68;
@mixin baseline($font-size, $scale: 2) {
@hdragomir
hdragomir / sm-annotated.html
Last active February 2, 2025 02:22
The deferred font loading logic for Smashing Magazine. http://www.smashingmagazine.com/
<script type="text/javascript">
(function () {
"use strict";
// once cached, the css file is stored on the client forever unless
// the URL below is changed. Any change will invalidate the cache
var css_href = './index_files/web-fonts.css';
// a simple event handler wrapper
function on(el, ev, callback) {
if (el.addEventListener) {
el.addEventListener(ev, callback, false);