Skip to content

Instantly share code, notes, and snippets.

View jzimdars's full-sized avatar

Jason Zimdars jzimdars

View GitHub Profile

Rdio -> Google Play Music

Abandon ship!

I've used the following method to export a playlist with 601 items, matching 580. The remaining 21 are a mix of artist or album mismatches, along with some tracks that just aren't available.

Requires

@paulirish
paulirish / what-forces-layout.md
Last active November 15, 2024 16:45
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@nuthatch
nuthatch / iOS 7 dynamic font mappings
Last active January 9, 2023 13:55
What is UIFontTextStyleHeadline *really*? Dump out preferredFontForTextStyle for UIFontTextStyleHeadline, UIFontTextStyleSubheadline, UIFontTextStyleBody, UIFontTextStyleFootnote, UIFontTextStyleCaption1, UIFontTextStyleCaption2 to examine the font name, weight, and point size.
+ (void)describePreferredFonts
{
static NSArray *textStyles;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
textStyles = @[UIFontTextStyleHeadline,
UIFontTextStyleSubheadline,
UIFontTextStyleBody,
UIFontTextStyleFootnote,
UIFontTextStyleCaption1,
@javan
javan / gist:3237348
Created August 2, 2012 14:10
Sublime Text 2: Preferences > Key Bindings - User
[
// Make paste-and-indent the default paste behavior
{ "keys": ["super+v"], "command": "paste_and_indent" },
{ "keys": ["super+shift+v"], "command": "paste" }
]
@mihar
mihar / gist:1263820
Created October 5, 2011 06:55
JavaScript equivalent of Array#to_sentence from Rails
Array.prototype.to_sentence = function() {
return this.join(", ").replace(/,\s([^,]+)$/, ' and $1')
}
@javan
javan / gist:1168475
Created August 24, 2011 16:32
Fix iPhone home button
Found this tip in comment here: http://www.tipb.com/2011/01/04/tipb-bug-home-button-working-iphone/
1.) Open any application
2.) Press and hold the power button until the slide to shutdown swipe bar appears.
3.) Release Power button
4.) Press and hold Home button Lightly
until screen returns to icon screen
@mudge
mudge / gist:1076046
Created July 11, 2011 15:06
JavaScript version of ActiveSupport's to_sentence method.
function toSentence(array) {
var wordsConnector = ", ",
twoWordsConnector = " and ",
lastWordConnector = ", and ",
sentence;
switch(array.length) {
case 0:
sentence = "";
break;

Jeremy Kemper's bio, as interpreted by me:

Jeremy Kemper is a former member of a regionally acclaimed dance group called "Sparkle Motion". After his ballet techniques were deemed to be "too controversial" for mainstream ballet, he joined a company called 37 signals. Now, when he isn't pirouetting through Rails internals or building web applications, you can find him doing extreme ballet in the streets of Brooklyn under the name "Periwinkle Thunderhorse".

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Cross-browser kerning-pairs & ligatures</title>
<style>
body { font-family: sans-serif; background: #f4f3f3; color: rgba(40, 30, 0, 1); width: 500px; margin: 80px auto; padding: 0px; }
a { color: rgba(15, 10, 0, 0.8); text-decoration: none; border-bottom: 1px solid; padding: 1px 1px 0px; -webkit-transition: background 1s ease; }
a:hover { background: rgba(0, 220, 220, 0.2); }
p, li { line-height: 1.5; padding: 0em 1em 0em 0em; margin: 0em 0em 0.5em; }
@jamis
jamis / Easy Marshmallow Recipe
Created December 10, 2009 22:38
Easy Gourmet Marshmallows
EASY MARSHMALLOWS
-----------------
Marshmallows are perhaps one of the simplest confections you can make. They only
require a handful of ingredients, a batch can be thrown together in 10-15 minutes
(plus *cough* 3 hours for them to set), and you can flavor them however you like.
(You haven't LIVED until you've had coconut marshmallows!)
Hardware needed: