Skip to content

Instantly share code, notes, and snippets.

View thatericsmith's full-sized avatar

Eric Smith thatericsmith

View GitHub Profile
@thatericsmith
thatericsmith / contenteditable.vue
Created October 13, 2020 18:09
Very basic Vue contenteditable
<template>
<span
contenteditable="true"
@input="$emit('updated', $event.target.innerHTML)"
v-html="content"
v-once
></span>
</template>
<script>
export default {
@thatericsmith
thatericsmith / donut_legend.js
Last active August 29, 2015 14:18
Show and hide Chart.js tooltips (Pie/Donut chart with legend) using jQuery
// <canvas id="donut"></canvas>
var ctx = $("#donut").get(0).getContext("2d");
var donut = new Chart(ctx).Doughnut(data,options);
$('#legend').html(donut.generateLegend());
$('#legend li').hover(function(){
var index = $(this).index();
var activeSegment = donut.segments[index];
activeSegment.save();
activeSegment.fillColor = activeSegment.highlightColor;
@thatericsmith
thatericsmith / foxycart-transactions-year.php
Created February 26, 2015 19:30
Get all FoxyCart transactions for a given year
<?php
// @thatericsmith
class FoxyAPI{
public $domain = 'YOURDOMAIN.foxycart.com';
public $api_key = 'YOUR API KEY';
public $year = 2014;
public function api($action,$foxyData = array()){
// foxy api
$foxy_domain = $this->domain;
@thatericsmith
thatericsmith / keybase.md
Created August 29, 2014 05:51
keybase.md

Keybase proof

I hereby claim:

  • I am thatericsmith on github.
  • I am thatericsmith (https://keybase.io/thatericsmith) on keybase.
  • I have a public key whose fingerprint is C353 DC48 FF61 5481 5401 AD76 439D D546 4993 1910

To claim this, I am signing this object:

var IS_TOUCH = false;
if('ontouchstart' in document){
$('body').removeClass('no-touch');
IS_TOUCH = true;
}
@thatericsmith
thatericsmith / json-token.html
Created June 3, 2013 23:45
Convergence's "json" token in action
<script>
$(function(){
var thejson = <@json type="item-list" slug="cities"/@>;
/*
Will return the following
{
"success":true,
"item-list":{
"id":"934",
"name":"Cities",
@thatericsmith
thatericsmith / menu-token.html
Last active December 16, 2015 01:49
The menu token in Convergence
<!--
Example for a site that has Home, About, Contact.
-->
<!-- TOKEN -->
<@menu type="main" id="main-nav"/@>
<!-- OUTPUT -->
@thatericsmith
thatericsmith / flexslider-no-border.css
Created December 11, 2012 17:38
Flexslider remove border
.flexslider{
background:none;
border:none;
box-shadow:none;
margin:0px;
}