Skip to content

Instantly share code, notes, and snippets.

View danest's full-sized avatar
😶

Kevin Urrutia danest

😶
View GitHub Profile
<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 / 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
@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 / 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 / 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 / .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: