Skip to content

Instantly share code, notes, and snippets.

View keithort's full-sized avatar

Keith Ort keithort

View GitHub Profile
@raybrownco
raybrownco / rem.scss
Created August 9, 2011 16:48
rem() is a Sass mixin that converts pixel values to rem values for whatever property is passed to it.
/*
* 'rem' is a Sass mixin that converts pixel values to rem values for whatever property is passed to it.
* It returns two lines of code — one of the regular pixel values (for IE), and another with the
* converted rem values (for everyone else). Special thanks to Chris Epstein (http://chriseppstein.github.com)
* and Martin Bavio (http://martinbavio.com) for the help and code!
*
* Sample input:
* .element {
* @include rem('padding',10px 0 2px 5px);
* }
@incredimike
incredimike / variousCountryListFormats.js
Last active June 27, 2025 07:11
List of Countries in various Javascript data structures: Alphabetical country lists & Country data objects.
// Lists of countries with ISO 3166 codes, presented in various formats.
// Last Updated: July 30, 2020
// If you're using PHP, I suggest checking out:
// https://github.com/thephpleague/iso3166
// or Laravel: https://github.com/squirephp/squire
//
// JS developers can check out:
// https://www.npmjs.com/package/iso3166-2-db
//
@timkelty
timkelty / config.rb
Created January 11, 2012 15:28
Compass config.rb
# Note that while this file is in our config folder, it is
# symlinked to our site folders, so paths are relative from there
# Require gems and Compass plugins
# require 'rgbapng'
# require 'compass-fancybox-plugin'
require 'compass-growl'
# General
output_style = :expanded
@saltednut
saltednut / Vagrantfile
Last active December 17, 2015 22:09
Vagrantfile to be used with drupal_cookbook
drupaldistro = ENV['DRUPAL_DISTRO']
project = ENV['DRUPAL_PROJECT']
Vagrant.configure("2") do |config|
# Install Chef
config.omnibus.chef_version = :latest
# The path to the Berksfile to use with Vagrant Berkshelf
config.berkshelf.enabled = true
config.berkshelf.berksfile_path = "./Berksfile"
<?php
include_once DRUPAL_ROOT . "/sites/golfchanneldev.prod.acquia-sites.com/settings.php";
$conf['stage_file_proxy_origin'] = 'http://www.golfchannel.com';
$conf['refresh_score_pages'] = FALSE;
$conf['gfc_customers_api_golfnow_url'] = 'http://develop.gnsvc.com/V1.1/TeeTimesAPIRest.svc/';
$conf['https'] = FALSE;
$cookie_domain = '.golfchannel.local';
// $conf['securepages_basepath'] = 'http://golfchannel.local';
// $conf['securepages_basepath_ssl'] = 'https://secure.golfchannel.local';
<?php
function gfc_customers_update_7001() {
//Move the scoreboard to the scoreboard region
db_update('block')
->fields(array(
'weight' => 2,
'region' => 'scoreboard_only',
))
->condition('module', 'views')
@Integralist
Integralist / 0. JavaScript Function Programming TOC.md
Last active July 3, 2018 04:57
JavaScript Function Programming (scratch pad) -> Most of the code here is modified from the excellent O'Reilly book "Functional JavaScript".

This code is modified from the excellent O'Reilly book "Functional JavaScript". You should buy it, I highly recommend it! Don't kid yourself into thinking this gist even remotely covers the great content from a 200+ page technical book on the subject; it doesn't. Buy the book and get the in-depth knowledge for yourself. It's worth it.

@staltz
staltz / introrx.md
Last active July 7, 2025 10:24
The introduction to Reactive Programming you've been missing
@ericelliott
ericelliott / essential-javascript-links.md
Last active June 14, 2025 18:43
Essential JavaScript Links
@paulirish
paulirish / what-forces-layout.md
Last active July 9, 2025 19:27
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