Skip to content

Instantly share code, notes, and snippets.

View CatinhoCR's full-sized avatar

Cato CatinhoCR

  • Costa Rica
  • 16:11 (UTC -06:00)
View GitHub Profile
@jacurtis
jacurtis / _spacing-helpers.scss
Last active April 15, 2024 12:05
SASS Margin and Padding Helpers Loop. Generates .m-t-10 type helper classes.
/*
This .scss loop will create "margin helpers" and "padding helpers" for use in your web projects.
It will generate several classes such as:
.m-r-10 which gives margin-right 10 pixels.
.m-r-15 gives MARGIN to the RIGHT 15 pixels.
.m-t-15 gives MARGIN to the TOP 15 pixels and so on.
.p-b-5 gives PADDING to the BOTTOM of 5 pixels
.p-l-40 gives PADDING to the LEFT of 40 pixels
@Rich-Harris
Rich-Harris / footgun.md
Last active April 19, 2024 07:47
Top-level `await` is a footgun

Edit — February 2019

This gist had a far larger impact than I imagined it would, and apparently people are still finding it, so a quick update:

  • TC39 is currently moving forward with a slightly different version of TLA, referred to as 'variant B', in which a module with TLA doesn't block sibling execution. This vastly reduces the danger of parallelizable work happening in serial and thereby delaying startup, which was the concern that motivated me to write this gist
  • In the wild, we're seeing (async main(){...}()) as a substitute for TLA. This completely eliminates the blocking problem (yay!) but it's less powerful, and harder to statically analyse (boo). In other words the lack of TLA is causing real problems
  • Therefore, a version of TLA that solves the original issue is a valuable addition to the language, and I'm in full support of the current proposal, which you can read here.

I'll leave the rest of this document unedited, for archaeological

@tomysmile
tomysmile / mac-php-composer-setup.md
Created July 11, 2016 10:45
Setup PHP Composer using Brew
@thierrypigot
thierrypigot / acf-missing.php
Created June 3, 2016 10:13
WordPress mu plugins to check if "Advanced Custom Fields Pro" is active.
<?php
if( !class_exists('acf') )
{
$tp_acf_notice_msg = __( 'This website needs "Advanced Custom Fields Pro" to run. Please download and activate it', 'tp-notice-acf' );
/*
* Admin notice
*/
add_action( 'admin_notices', 'tp_notice_missing_acf' );
function tp_notice_missing_acf()
@themepaint
themepaint / Register Custom Taxonomy Woocommerce Products
Created April 22, 2016 11:59
Register Custom Taxonomy Woocommerce Products
// Register Custom Taxonomy
function ess_custom_taxonomy_Item() {
$labels = array(
'name' => 'Brands',
'singular_name' => 'Brand',
'menu_name' => 'Brands',
'all_items' => 'All Brands',
'parent_item' => 'Parent Brand',
'parent_item_colon' => 'Parent Brand:',
@btroncone
btroncone / ngrxintro.md
Last active February 9, 2024 15:37
A Comprehensive Introduction to @ngrx/store - Companion to Egghead.io Series

Comprehensive Introduction to @ngrx/store

By: @BTroncone

Also check out my lesson @ngrx/store in 10 minutes on egghead.io!

Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!

Table of Contents

@BurlesonBrad
BurlesonBrad / functions.php
Created March 10, 2016 21:34 — forked from TimBHowe/functions.php
Reduce or remove WooCommerce 2.5 minimum password strength requirement for creating a user account. Warning: Use at your own risk.
<?php
/**
*Reduce the strength requirement on the woocommerce password.
*
* Strength Settings
* 3 = Strong (default)
* 2 = Medium
* 1 = Weak
* 0 = Very Weak / Anything
*/
@danielbachhuber
danielbachhuber / collection-filter.js
Last active April 18, 2023 20:30
Add a custom taxonomy dropdown filter to the WordPress Media Library
(function(){
/**
* Create a new MediaLibraryTaxonomyFilter we later will instantiate
*/
var MediaLibraryTaxonomyFilter = wp.media.view.AttachmentFilters.extend({
id: 'media-attachment-taxonomy-filter',
createFilters: function() {
var filters = {};
// Formats the 'terms' we've included via wp_localize_script()
@rveitch
rveitch / sass-7-1-pattern.scss
Last active April 23, 2024 08:10
Sass 7-1 Pattern
sass/
|
|– base/
| |– _reset.scss # Reset/normalize
| |– _typography.scss # Typography rules
| ... # Etc…
|
|– components/
| |– _buttons.scss # Buttons
| |– _carousel.scss # Carousel
@PurpleBooth
PurpleBooth / am-i-ready-to-open-source-this.md
Last active February 4, 2021 22:17
Checklist to see if your open source repo is primetime ready!

Am I ready to Open Source This?

The checklist:

  1. A readme following a good template
  2. A contributing.md with a code of conduct.
  3. A license
  4. Travis configuration
  5. A way for people to raise issues
  6. Link to it