Skip to content

Instantly share code, notes, and snippets.

View marcobarbosa's full-sized avatar

Marco Barbosa marcobarbosa

View GitHub Profile
@marcobarbosa
marcobarbosa / front-end-setup.md
Last active November 29, 2016 06:16
Reference for the steps necessary to code a good front-end project on a Mac.

Front-end coding environment set-up

This guide covers pretty much all that you need to have installed in your Mac for a top notch front-end coding environment.

This guide also assumes that you are going to use yeoman or grunt for your project.

XCode

It is recommended that you have Xcode installed and it's Command Line Tools to give you any command line binary that you might need (such as wget). You can also download it within Xcode itself

@marcobarbosa
marcobarbosa / flight-delegation.js
Last active December 17, 2015 18:59
Flight delegation
define(
[
'flight/component'
],
function (defineComponent) {
return defineComponent(helloWorld);
Drop in replace functions for setTimeout() & setInterval() that
make use of requestAnimationFrame() for performance where available
http://www.joelambert.co.uk
Copyright 2011, Joe Lambert.
Free to use under the MIT license.
http://www.opensource.org/licenses/mit-license.php
@marcobarbosa
marcobarbosa / gist:7941547
Created December 13, 2013 08:54
animate element using SMIL
<animate attributeType="XML"
attributeName="x"
from="-100" to="120"
dur="10s"
repeatCount="indefinite"/>
@marcobarbosa
marcobarbosa / gist:7945005
Last active December 31, 2015 05:59
keyframe animation example
@keyframes foobar {
0%,
50% {
opacity: 0;
}
54%,
80% {
opacity: 1;
}
84%,
@marcobarbosa
marcobarbosa / Wordpress custom tiny_mce
Last active January 4, 2016 03:29
Wordpress tiny_mce toolbar customizations
<?php
/**
* Customise the editor buttons.
*
* This function takes care of the first row.
*
* @param Array $buttons Buttons that are going to be displayed if unchanged.
*/
function tiny_mce_buttons($buttons) {
@marcobarbosa
marcobarbosa / rio-featured-images.php
Created May 2, 2014 11:33
Example of using responsive-io with Wordpress featured images
@marcobarbosa
marcobarbosa / loop.php
Created May 12, 2014 12:17
wordpress the loop
<?php
if ( have_posts() ) {
while ( have_posts() ) {
the_post();
//
// Post Content here
//
} // end while
} // end if
?>
@marcobarbosa
marcobarbosa / gist:8e0bab9424baf092c603
Created August 8, 2014 09:25
javascript and cookies
// Based on: http://stackoverflow.com/a/1599291
// Fixed jshint errors and cleaned up a little.
function createCookie(name, value, days) {
var expires = '';
if (days) {
var date = new Date();
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
expires = '; expires=' + date.toGMTString();
@marcobarbosa
marcobarbosa / filter-branch.sh
Created August 31, 2015 15:19
Remove binary from GIT history
#!/usr/bin/env bash
git filter-branch --index-filter 'git rm -r -q --cached --ignore-unmatch '$1'' --prune-empty --tag-name-filter cat -- --all
rm -rf .git/refs/original/
git reflog expire --expire=now --all
git gc --prune=now
git gc --aggressive --prune=now