Skip to content

Instantly share code, notes, and snippets.

View zslabs's full-sized avatar

Zach Schnackel zslabs

View GitHub Profile
@zslabs
zslabs / foundation_3.2.0_media_queries
Created November 5, 2012 19:39
Media queries not included in apps.scss by default in Foundation 3.2.0 (added at the bottom of this file)
// You custom settings file to override Foundation defaults
@import "settings";
// Comment out this import if you are customizing you imports below
// @import "foundation";
// ----------------------------------------
// Import specific parts of Foundation by commenting the import "foundation"
// and uncommenting what you want below. You must uncomment the following if customizing
<?php
add_theme_support('menus');
/*
http://codex.wordpress.org/Function_Reference/register_nav_menus#Examples
*/
register_nav_menus( array(
'main-menu' => 'Main Menu' // registers the menu in the WordPress admin menu editor
) );
@zslabs
zslabs / provision.sh
Created January 15, 2014 15:28
Install Ruby (RVM)
\curl -L https://get.rvm.io | bash -s stable
source /usr/local/rvm/scripts/rvm
rvm requirements
rvm install ruby
rvm use ruby --default
rvm rubygems current
@zslabs
zslabs / gist:88fd26cdac40a9ba0ebd92b77229491e
Created May 26, 2016 19:26
Harvest Chosen fallback mobile usability
Know how https://harvesthq.github.io/chosen/ falls back to a normal <select> in unsupported browsers? The following is a workaround for still allowing use of the `data-placeholder` property when initiated, but a sane fallback when not.
HTML output:
<div class="ChosenSelect">
<select required data-placeholder="Choose a fruit">
<option value="">Choose a fruit</option>
<option value="Apples">Apples</option>
<option value="Mangos">Mangos</option>
<option value="Pears">Pears</option>
//
// <button> reset
//
// 1. Remove default browser appearance for buttons.
// 2. Remove margins.
// 3. Remove borders for IE.
// 4. Normalize font and color not inherited by `button`.
// 5. Address `overflow` in IE
// 6. Normalize cursor style
@zslabs
zslabs / .hyper.js
Last active April 24, 2018 02:06
HyperJS
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'stable',
@zslabs
zslabs / modernizr_enqueue
Created November 8, 2012 01:42
Enqueue Modernizr before all other scripts
function basey_scripts_header() {
wp_enqueue_script('modernizr', get_template_directory_uri() . '/js/modernizr.foundation.js', '', null, false);
}
add_action('template_redirect','basey_scripts_header', 8);
@zslabs
zslabs / StylesContext.tsx
Created December 16, 2021 16:09 — forked from alexkuz/StylesContext.tsx
Styled Components in Remix
import { createContext } from 'react';
import { ServerStyleSheet } from 'styled-components';
export default createContext<{
styles: React.ReactNode[];
renderMode: 'head' | 'body' | 'all';
}>({ styles: [], renderMode: 'all' });
@zslabs
zslabs / getComponents.js
Created April 22, 2022 17:18 — forked from steveruizok/getComponents.js
Get components and styles (as full nodes) from a Figma file.
async function getComponents(fileKey, token) {
// Get file
const file = await fetch(`https://api.figma.com/v1/files/${fileKey}`, {
headers: { "X-Figma-Token": token }
}).then((r) => r.json())
if (file.err === undefined) {
// Get style ids
const styleIds = Object.keys(file.styles)