Skip to content

Instantly share code, notes, and snippets.

View hughker's full-sized avatar

Winston Hughes hughker

View GitHub Profile
@hughker
hughker / .block
Created November 10, 2016 00:49 — forked from mbostock/.block
Text Along a Path
license: gpl-3.0
@hughker
hughker / example.html
Created November 8, 2016 18:22
Get Vimeo Thumb Image
<script type="text/javascript">
$.ajax({
type:'GET',
url: 'https://vimeo.com/api/v2/video/' + video_id + '.json',
jsonp: 'callback',
dataType: 'jsonp',
success: function(data){
var thumbnail_src = data[0].thumbnail_large;
$('#thumb_wrapper').append('<img src="' + thumbnail_src + '"/>');
}
@hughker
hughker / another.css
Last active October 14, 2016 22:40
Gradient at bottom of text block thingy
.guest-post .guest-bottom {
height: 100px;
position: absolute;
bottom: 0;
width: 100%;
background-color: rgba(249, 249, 249, 0.4);
background-image: -moz-linear-gradient(top, rgba(255, 255, 255, 0), #f9f9f9);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(rgba(255, 255, 255, 0)), to(#f9f9f9));
background-image: -webkit-linear-gradient(top, rgba(255, 255, 255, 0), #f9f9f9);
background-image: -o-linear-gradient(top, rgba(255, 255, 255, 0), #f9f9f9);
@hughker
hughker / nginx.conf
Created October 6, 2016 03:48 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@hughker
hughker / virtual.conf
Created October 3, 2016 00:59 — forked from tmaiaroto/virtual.conf
Nginx Virtual Host Setup for OS X using Homebrew
#
# A virtual host using mix of IP-, name-, and port-based configuration.
# This is based on using Homebrew for OS X. You can use this in other
# cases though, but you'll likely need to adjust some of the paths below.
#
server {
# Replace this port with the right one for your requirements
# listen 80 [default|default_server]; #could also be 1.2.3.4:80
@hughker
hughker / GIF-Screencast-OSX.md
Created September 29, 2016 03:56 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@hughker
hughker / readme.md
Last active September 28, 2016 16:43
Shopify SVG Snippet Include

USE

{% include 'svgs' with 'example-1' %}

WHAT?

You'll want to paste the internal SVG code where the ellipsis is in the example code. Also, make sure your SVGs are properly sized before exporting so that you can enter the correct WIDTH + HEIGHT into the viewbox="0 0 WIDTH HEIGHT" for that SVG.

You'll also be replacing the example-1 with whatever you want to call the icon (make sure to hyphenate it).

@hughker
hughker / video-embed-check.liquid
Last active September 14, 2016 18:42
Liquid check for embed video type
{% comment %}
Quick logic to check what type of video to embed,
then strip Video ID so you can use the correct embed wrapper.
{% endcomment %}
{% assign brand_video = source_of_video_url %}
{% assign videoIsVimeo = false %}
{% assign videoIsYouTube = false %}
{% if brand_video contains 'vimeo' %}
@hughker
hughker / Much much simpler option selector for Shopify
Created May 25, 2016 16:25 — forked from zakhardage/Much much simpler option selector for Shopify
Much simpler version of Shopify's option_selection.js for separating product options into their own dropdown menus.
<form action="/cart/add" method="post">
{% if product.variants.size > 1 %}
{% if product.options[0] %}
{% assign used = '' %}
<label for="select-one">{{ product.options[0] }}</label>
<select id='select-one' onchange="letsDoThis()">
{% for variant in product.variants %}
{% unless used contains variant.option1 %}
<option value="{{ variant.option1 }}">{{ variant.option1 }}</option>
{% capture used %}{{ used }} {{ variant.option1 }}{% endcapture %}
{% comment %}
Adds the following events:
* ViewContent on all pages
* Dynamic AddToCart on Product pages
* Dynamic InitiateCheckout from Cart page into Checkout
* Purchase on Checkout complete
{% endcomment %}
<!-- Shopify Theme Facebook Pixel Code -->
<script type="text/javascript">
!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?