Skip to content

Instantly share code, notes, and snippets.

View danest's full-sized avatar
😶

Kevin Urrutia danest

😶
View GitHub Profile
@danest
danest / .solargraph.yml
Last active April 13, 2024 01:42 — forked from DRBragg/.solargraph.yml
My config with steps to use solargraph for Rails projects in VS Code (WIP)
---
include:
- 'app/**/*.rb'
- 'config/**/*.rb'
- 'lib/**/*.rb'
exclude:
- spec/**/*
- vendor/**/*
- '.bundle/**/*'
require:
@danest
danest / HACK-IT.md
Created April 4, 2024 01:48 — forked from roachhd/HACK-IT.md
Jekyll + Liquid quick bits ❤️❤️

First steps

It's very simple to get started with Liquid. A Liquid template is rendered in two steps: Parse and Render. For an overview of the Liquid syntax, please read [[Liquid for Designers]].

@template = Liquid::Template.parse("hi {{name}}")  # Parses and compiles the template
@template.render( 'name' => 'tobi' )               # Renders the output => "hi tobi"
@danest
danest / email-widget.js
Created August 20, 2019 12:52 — forked from nozzlegear/email-widget.js
This is an example email capturing widget, used to demonstrate the power of Shopify's script tags to add dynamic functionality to a Shopify store front. Learn more about using Shopify script tags with The Shopify Development Handbook at https://nozzlegear.com/shopify-development-handbook.
(function ()
{
//Build a pseudo-class to prevent polluting our own scope.
var api = {
Settings: {},
Vox: {},
Start: function ()
{
//Get the *.myshopify.com domain
var shop = Shopify.shop;
@danest
danest / header_ogp.php
Created May 6, 2018 12:15 — forked from makotokw/header_ogp.php
Open Graph protocol for WordPress
<?php
/**
* Open Graph protocol for WordPress
* @version 0.9.2
* @author makoto_kw
* @link https://gist.github.com/3399585
*/
// key into custom fields for description. Default is for All in One SEO Pack
define('WP_OGP_POST_DESCRIPTION_KEY', '_aioseop_description');
@danest
danest / get_mxers.rb
Created October 22, 2017 23:15 — forked from afair/get_mxers.rb
Ruby: lookup email MX servers for a domain
require 'resolv'
class Domain
def mxers(domain)
mxs = Resolv::DNS.open do |dns|
ress = dns.getresources(domain, Resolv::DNS::Resource::IN::MX)
ress.map { |r| [r.exchange.to_s, IPSocket::getaddress(r.exchange.to_s), r.preference] }
end
return mxs
<script>
(function(){
var userAgent = navigator.userAgent || navigator.vendor || window.opera;
var mobile = (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(userAgent)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac(
@danest
danest / move-proceed-to-checkout.php
Created September 8, 2017 20:34 — forked from BurlesonBrad/move-proceed-to-checkout.php
Put Checkout button next to the Update Cart button (AWESOME on mobile!!) https://bradgriffin.me/proceed-to-checkout/
add_action( 'woocommerce_cart_actions', 'move_proceed_button' );
function move_proceed_button( $checkout ) {
echo '<a href="' . esc_url( WC()->cart->get_checkout_url() ) . '" class="checkout-button button alt wc-forward" >' . __( 'Proceed to Checkout', 'woocommerce' ) . '</a>';
}
@danest
danest / how-to-set-up-stress-free-ssl-on-os-x.md
Created August 31, 2017 23:25 — forked from lostmahbles/how-to-set-up-stress-free-ssl-on-os-x.md
How to set up stress-free SSL on an OS X development machine

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying

@danest
danest / gist:14e3da49d061c01b7aeb
Last active August 29, 2015 14:01 — forked from lucasfais/gist:1207002
Sublime Text 3 – Useful Shortcuts (Mac OS X) and Plugins

Sublime Text 3 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@danest
danest / optimspy
Last active June 17, 2016 08:44
A way to browse or spy on the Optimizely experiments running on a website. How to use: https://gist.github.com/danest/73eda651cd4fb4ec76fb#comment-1230671
(function (e, t) {
var n = window.jQuery || window.$ || window.optimizely && window.optimizely.$;
n("head").append("<scr" + "ipt>(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,'script','//www.google-analytics.com/analytics.js','ga');ga('create', 'UA-49590743-2', 'derp',{'name': 'optimizelyspytool'});ga('optimizelyspytool.send', 'pageview','/" + (!t ? "x/" : "") + "'+location.hostname);</sc" + "ript>");
n("#opt_container,#opt_styles,#opt_backdrop").remove();
n("body").append("<div id='opt_backdrop'/>");
n("head").append("<style id='opt_styles'> #opt_backdrop {position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,.4);z-index:99999998} #opt_container{ position:fixed; overflow-y:auto; background:#FFF;