Skip to content

Instantly share code, notes, and snippets.

<snippet>
<content><![CDATA[
@include breakpoint(${1:papa-bear / mama-bear / baby-bear}) {
${2:}
}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>mq</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
@hachesilva
hachesilva / exit-exit-sc.user.js
Created September 2, 2016 20:17 — forked from noromanba/exit-exit-sc.user.js
remove exit.sc redirector from links on SoundCloud for UserScript
// ==UserScript==
// @name exit exit.sc
// @namespace http://noromanba.flavors.me
// @description remove exit.sc redirector from links on SoundCloud for UserScript
// @include https://soundcloud.com/*
// @grant none
// @noframes
// @run-at document-end
// @version 2016.6.8.1
// @homepage https://gist.github.com/noromanba/6b83ef63fe8b794364267bd832fdbc71
// This example populate the 2016,2017 and 2018 holidays in Colombia
[2016, 2017, 2018].forEach(function(year){
var holidaysHelper = new HolidaysHelper(year);
// Fixed
[
{month: HolidaysHelper.Months.January, day: 1, description: "Año Nuevo"},
{month: HolidaysHelper.Months.May, day: 1, description: "Día del Trabajo"},
{month: HolidaysHelper.Months.July, day: 20, description: "Grito de Independencia"},
{month: HolidaysHelper.Months.August, day: 7, description: "Batalla de Boyacá"},
@hachesilva
hachesilva / functions.php
Created March 14, 2017 18:19 — forked from corsonr/functions.php
Display WooCommerce product variations dropdown select on the shop page
<?php
// Display variations dropdowns on shop page for variable products
add_filter( 'woocommerce_loop_add_to_cart_link', 'woo_display_variation_dropdown_on_shop_page' );
function woo_display_variation_dropdown_on_shop_page() {
global $product;
if( $product->is_type( 'variable' )) {
@hachesilva
hachesilva / convert-integer-to-roman.php
Created September 8, 2017 18:22 — forked from edutrul/convert-integer-to-roman.php
How to convert integer to Roman number
<?php
/**
* Converts integer to Roman.
*
* @param int $integer
* Integer to be converted to Roman string.
*
* @return string
*/
public function integerToRoman($integer) {
@hachesilva
hachesilva / no-hackerrank.md
Created March 26, 2018 20:48 — forked from fasiha/no-hackerrank.md
A prospective employer invited me to do a HackerRank test. Here's my proposed alternative.

Well, that was unexpected. In the following, I’m trying to follow Jon Evans’ advice from “The Terrible Technical Interview”.


To: [email protected]
From: Ahmed Fasih
Subject: Re: Programming Test Invitation

Hi there! Thanks for offering to let me take a HackerRank test for ABC, I appreciate the vote of confidence.

@hachesilva
hachesilva / Contract Killer 3.md
Created September 21, 2018 16:52
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Original post

@hachesilva
hachesilva / minimal-analytics-snippet.js
Last active January 15, 2019 15:44 — forked from DavidKuennen/minimal-analytics-snippet.js
Minimal Analytics Snippet
(function (context, trackingId, options) {
const history = context.history;
const doc = document;
const nav = navigator || {};
const storage = localStorage;
const encode = encodeURIComponent;
const pushState = history.pushState;
const typeException = 'exception';
const generateId = () => Math.random().toString(36);
const getId = () => {
@hachesilva
hachesilva / XDebug-vscode-vagrant-bundle-setup.md
Last active May 4, 2020 09:18 — forked from sveggiani/instructions.md
[Configure XDebug, Visual Studio Code for a Vagrant VM] #debug #vm #vscode

Configure XDebug, Visual Studio Code for a Vagrant VM

1. Assumptions

  • Project (Drupal) is served on /var/www/html in the Vagrant box
  • Local project files location: c:\Users\username\Work\projects\my-project\repo\html
  • Guest machine IP is 10.0.2.2 (if this doesn't work, run route -nee in the VM and look for the gateway address)

2. Configuration

@hachesilva
hachesilva / _spacing.scss
Created January 7, 2021 21:14 — forked from XanderLuciano/_spacing.scss
This is a simple sass (rather scss) recreation of a bootstrap like spacing utility which allows you to quickly and easily set margin and padding sizes through classes like `mx-3`, `p-2`, and `pt-5`. You can define spacing values in $spacing and add or remove shorthand properties with the $prefixes variable. This uses `!important` to override any…
@mixin simpleSpace {
// margin and padding values
$spacings: (
0,
.25rem,
.5rem,
1rem,
1.5rem,
2rem,