Skip to content

Instantly share code, notes, and snippets.

View ezos86's full-sized avatar

Eric Cavazos ezos86

View GitHub Profile
//
// SVG — hasClass, addClass, removeClass, toggleClass
// Source:
// https://gist.github.com/branneman/8436956
// Taken and adapted from:
// http://toddmotto.com/hacking-svg-traversing-with-ease-addclass-removeclass-toggleclass-functions/
//
if (SVGElement && SVGElement.prototype) {
@ezos86
ezos86 / Animated-SVG-Rocket.markdown
Created February 7, 2015 06:14
Animated SVG Rocket

Animated SVG Rocket

Animated SVG Rocket - SVG and keyframes and a little js to start and stop.

A Pen by ezos86 on CodePen.

License.

@ezos86
ezos86 / Panel-Flipper---Btn-Toggle.markdown
Created February 11, 2015 01:25
Panel Flipper - Btn Toggle

Panel Flipper - Btn Toggle

A Panel that flips around based on a button toggle

A Pen by ezos86 on CodePen.

License.

@ezos86
ezos86 / Vertically-Aligned-Content---Annoying.markdown
Created February 11, 2015 01:46
Vertically Aligned Content - Annoying
@ezos86
ezos86 / QwQmZb.markdown
Last active August 29, 2015 14:15
Sass Margin/Padding Mixin
@ezos86
ezos86 / index.html
Last active August 29, 2015 14:15
pvLdBg
<button class="gen">Generate</button>
@ezos86
ezos86 / Button-Blink.markdown
Created February 27, 2015 21:16
Button Blink
// tinyxhr by Shimon Doodkin - licanse: public doamin - https://gist.github.com/4706967
//
// tinyxhr("http://site.com/ajaxaction",function (err,data,xhr){ if (err) console.log("goterr ",err,'status='+xhr.status); console.log(data) });
// tinyxhr("http://site.com/ajaxaction",function (err,data,xhr){ if (err) console.log("goterr ",err,'status='+xhr.status); console.log(data) },'POST','value1=1&value2=2');
// tinyxhr("http://site.com/ajaxaction.json",function (err,data,xhr){ if (err) console.log("goterr ",err,'status='+xhr.status); console.log(data); console.log(JSON.parse(data)) },'POST',JSON.stringify({value:1}),'application/javascript');
// cb - a callback function like: function (err,data,XMLHttpRequestObject){ if (err) throw err; }
//
function tinyxhr(url,cb,method,post,contenttype)
{
@ezos86
ezos86 / README.md
Last active August 29, 2015 14:16 — forked from oodavid/README.md

Backup MySQL to Amazon S3

This is a simple way to backup your MySQL tables to Amazon S3 for a nightly backup - this is all to be done on your server :-)

Sister Document - Restore MySQL from Amazon S3 - read that next

1 - Install s3cmd

this is for Centos 5.6, see http://s3tools.org/repositories for other systems like ubuntu etc

@ezos86
ezos86 / gist:68cfdf07c883269a43dd
Created March 28, 2015 21:18
Percentage Chance on a Random Pick Function
var choices = [
[10, "apples"],
[20, "oranges"],
[70, "bananas"]
];
function pickChoice() {
rand = Math.floor(Math.random() * 100);
choice = -1;