Skip to content

Instantly share code, notes, and snippets.

@tvpmb
tvpmb / questions.txt
Created November 13, 2012 20:58
How to make responsive designs with code
Define all your page elements:
LAYOUT
-----------------------------------------------------------
Page Style?
- Fixed width responsive
- Dynamic width responsive
- Single page application (with internal scroll elements)
Header?
- Fixed top
@tvpmb
tvpmb / checkbox.css
Created November 21, 2012 01:07
Trello Checkbox
.task .checkbox {
background: white;
border-radius: 3px;
-webkit-box-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
box-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
border: 1px solid #B9B9B9;
border-bottom-color: #999;
border-top-color: #CCC;
font-weight: bold;
position: absolute;
@tvpmb
tvpmb / watchResize.js
Created November 28, 2012 06:30 — forked from aarongustafson/watchResize.js
Efficient callback management for window.onresize
(function(window){
window.watchResize = function(callback)
{
var resizing;
callback.size = 0;
function done()
{
var curr_size = window.innerWidth;
clearTimeout( resizing );
resizing = null;
@tvpmb
tvpmb / US State List
Created February 7, 2013 22:10
JSON Array with List of US States with 2-char ISO codes.
[
{"name":"Alabama","alpha-2":"AL"},
{"name":"Alaska","alpha-2":"AK"},
{"name":"Arizona","alpha-2":"AZ"},
{"name":"Arkansas","alpha-2":"AR"},
{"name":"California","alpha-2":"CA"},
{"name":"Colorado","alpha-2":"CO"},
{"name":"Connecticut","alpha-2":"CT"},
{"name":"Delaware","alpha-2":"DE"},
{"name":"District of Columbia","alpha-2":"DC"},

An ongoing project to catalogue all of these sneaky, hidden, bleeding edge selectors as I prepare my JSConf EU 2012 talk.

Everything is broken up by tag, but within each the selectors aren't particularly ordered.

I have not tested/verified all of these. Have I missed some or got it wrong? Let me know. - A

A friendly reminder that you may need to set this property on your target/selected element to get the styling results you want:

-webkit-appearance:none;

.Button {
font-size: 20px;
}
@tvpmb
tvpmb / view.events.js
Created May 29, 2013 16:28
Backbone.js View, Event and Method Pattern, using require.js
define([
//"modules/tvpmodule/tvpview",
],
function() {
// Simple events mapping
var Events = {
"click .selector": "handleClick"
};
@tvpmb
tvpmb / youtube_iframe_api.js
Created August 13, 2013 15:54
Backbone JS View fragment for Youtube IFrame API
playVideo: function() {
this.hidePoster();
if (!YT) {
$('head').append('<script src="//www.youtube.com/iframe_api" type="text/javascript"></script>');
}
if (this.player) {
this.player.loadVideoById(this.videoId);
this.player.playVideo();
} else {
#!/bin/bash
# Download all VMWare Fusion machines from Modern.IE Website to test your Website/Web Application in Microsoft Internet Explorer on Mac OSX. All VM's and other VM's for Windows and Linux and other Virtual Manager's such as VirtualBox can be found at http://modern.ie/
# Don't have cURL or want to learn more, visit http://curl.haxx.se/.. are you really a Developer? First part of that sentence comes from the MS site.
read -p "--> Downloading Internet Explorer 6-10 on Windows XP/7/8 Appliances for VMWare Fusion. Large downloads ahead. (Press Enter to continue)."
echo "--> Download Internet Explorer 6 on Microsoft Windows XP Appliance for VMWare Fusion."
curl --progress-bar -O "http://virtualization.modern.ie/vhd/IEKitV1_Final/VMWare_Fusion/IE6_XP/IE6.XP.For.MacVMware.sfx"
echo "--> Download Internet Explorer 8 on Microsoft Windows XP Appliance for VMWare Fusion."
@tvpmb
tvpmb / TVPage_Magento_Conversion.phtml
Last active August 29, 2015 14:03
TVPage Magento PHP Conversion Tracking Script
<!-- START TVPAGE CONVERSION SCRIPT -->
<?php
$order = Mage::getModel('sales/order')->loadByIncrementId($this->getOrderId());
$items = $order->getAllVisibleItems();
$trackItems = Array();
foreach($items as $i) {
$trackItems[] = '{ sku: "'.$i->getSku().'", price:"'.$i->getBasePrice().'", quantity:'.$i->getQtyOrdered().' }';
}