Skip to content

Instantly share code, notes, and snippets.

@hachesilva
hachesilva / de-drupalizing-the-login-form.php
Created March 3, 2013 01:19
"De-Drupalizing The Login Form" correction Since the repository where Morten DK commited his code seems to be private, I decided to correct the code from his article and give my own twist to it. I also added more fixes, like not being able to see the "Create new account" link if the site does not allow user registrations and fixing not only the …
<?php
/**
* Implements hook_preprocess_HOOK().
*
*/
function MYTHEME_preprocess_html(&$vars) {
// Fixes page titles for login, register & password.
switch (current_path()) {
case 'user':
$vars['head_title_array']['title'] = t('Login');
<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á"},
.paypal-blue {
background-color: #009cde;
background-image: radial-gradient(circle farthest-side at center bottom, #009cde, #003087 125%);
}
.virgin-pink {
background: linear-gradient(to bottom,rgba(191,33,112,1) 0,rgba(198,32,104,1) 19%,rgba(218,30,80,1) 77%,rgba(218,30,80,1) 94%);
}
.ib-green {
@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 / js.js
Created April 3, 2017 21:48
Js boiler
+ function($) {
"use strict";
var StyleEditor = function() {
this.someState = false;
this.config = {
sideNavSelector: '.se__side-drawer',
secondaryDrawers: [
'.se__settings__theme-library',
// Expose module as global variable
var Module = function(){
// Inner logic
function sayHello(){
console.log('Hello');
}
// Expose API
return {
sayHello: sayHello
@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) {
.atomicobject.com {
padding-bottom: 15px;
padding-bottom: 1.5rem;
font-family: 'Merriweather', serif;
font-size: 17px;
line-height: 30px;
font-weight: 100;
}