Skip to content

Instantly share code, notes, and snippets.

View jdsteinbach's full-sized avatar
💭
💻

James Steinbach jdsteinbach

💭
💻
View GitHub Profile
@jdsteinbach
jdsteinbach / itermProfile.json
Last active August 31, 2021 20:17
My .oh-my-zsh theme
{
"Ansi 6 Color" : {
"Red Component" : 0.30980393290519714,
"Color Space" : "Calibrated",
"Blue Component" : 0.9686274528503418,
"Alpha Component" : 1,
"Green Component" : 0.76470589637756348
},
"Ansi 12 Color" : {
"Red Component" : 0.26666668057441711,
@scottopolis
scottopolis / wp-api-custom-taxonomies.php
Created October 27, 2015 22:27
Add custom taxonomies to the WP-API
<?php
function ms_add_tax_to_api() {
$taxonomies = get_taxonomies( '', 'objects' );
foreach( $taxonomies as $taxonomy ) {
$taxonomy->show_in_rest = true;
}
}
add_action( 'init', 'ms_add_tax_to_api', 30 );
@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
@jdsteinbach
jdsteinbach / index.php
Last active August 29, 2015 14:24
Self-Hosted Faux-API Script for Cotton Bureau Shirt Sales Data
<?php
header('Content-Type: application:json');
header("Access-Control-Allow-Origin: *");
/* CONFIG - EDIT THESE VARIABLEs TO YOUR HEART'S CONTENT */
$shirt_url = 'https://cottonbureau.com/products/your-shirt';
$cache_duration = 60; // in minutes
$notification_email = '[email protected]';
@jdsteinbach
jdsteinbach / markup.html
Last active August 29, 2015 14:22
Boilerplate Markup for Embedding a Google Map
<script src="http://maps.googleapis.com/maps/api/js"></script>
<script>
function initialize() {
var lat = '38.897922',
lng = '-77.036541',
loc = new google.maps.LatLng(lat, lng),
mapOptions = {
center: loc,
zoom: 15,
scrollwheel: false,
@Lewiscowles1986
Lewiscowles1986 / lc-svg-upload.php
Last active August 4, 2016 13:45
SVG Media Plugin for WordPress (Works since 4.1.2!)
<?php
// Please see https://github.com/Lewiscowles1986/WordPressSVGPlugin from now on
@ericrasch
ericrasch / WP Security README.md
Last active February 17, 2022 09:17
Hardening & Improving WordPress Security
@bobbygrace
bobbygrace / trello-css-guide.md
Last active November 3, 2024 14:56
Trello CSS Guide

Hello, visitors! If you want an updated version of this styleguide in repo form with tons of real-life examples… check out Trellisheets! https://github.com/trello/trellisheets


Trello CSS Guide

“I perfectly understand our CSS. I never have any issues with cascading rules. I never have to use !important or inline styles. Even though somebody else wrote this bit of CSS, I know exactly how it works and how to extend it. Fixes are easy! I have a hard time breaking our CSS. I know exactly where to put new CSS. We use all of our CSS and it’s pretty small overall. When I delete a template, I know the exact corresponding CSS file and I can delete it all at once. Nothing gets left behind.”

You often hear updog saying stuff like this. Who’s updog? Not much, who is up with you?

@p3t3r67x0
p3t3r67x0 / pseudo_elements.md
Last active November 2, 2024 12:19
A CSS pseudo-element is used to style specified parts of an element. In some cases you can style native HTML controls with vendor specific pseudo-elements. Here you will find an list of cross browser specific pseudo-element selectors.

Styling native elements

Native HTML controls are a challenge to style. You can style any element in the web platform that uses Shadow DOM with a pseudo element ::pseudo-element or the /deep/ path selector.

video::webkit-media-controls-timeline {
  background-color: lime;
}

video /deep/ input[type=range] {
@lunelson
lunelson / gulpfile.js
Last active August 29, 2015 14:09
Configuration to run sassc on a single file in test subdir of libsass/sassc in libsass repo
// _ __ _ _
// | | / _(_) |
// __ _ _ _| |_ __ | |_ _| | ___
// / _` | | | | | '_ \| _| | |/ _ \
// | (_| | |_| | | |_) | | | | | __/
// \__, |\__,_|_| .__/|_| |_|_|\___|
// __/ | | |
// |___/ |_|
var gulp = require('gulp');