Skip to content

Instantly share code, notes, and snippets.

View joaocunha's full-sized avatar
Web Performance

João Cunha joaocunha

Web Performance
View GitHub Profile
@joaocunha
joaocunha / .jshintrc.js
Last active August 29, 2015 14:10 — forked from connor/.jshintrc.js
// NOTE: I added the .js extension to this gist so it would have syntax highlighting. This file should have NO file extension
{
// Settings
"passfail" : false, // Stop on first error.
"maxerr" : 100, // Maximum error before stopping.
// Predefined globals whom JSHint will ignore.
"browser" : true, // Standard browser globals e.g. `window`, `document`.
@joaocunha
joaocunha / pre-commit
Last active August 29, 2015 14:10 — forked from Simbul/pre-commit
#!/usr/bin/env ruby
# This pre-commit hook will prevent any commit to forbidden branches
# (by default, "staging" and "production").
# Put this file in your local repo, in the .git/hooks folder
# and make sure it is executable.
# The name of the file *must* be "pre-commit" for Git to pick it up.
FORBIDDEN_BRANCHES = ["staging", "production"]
@joaocunha
joaocunha / pre-commit
Last active August 29, 2015 14:10 — forked from iamdustan/pre-commit
#!/bin/bash
# Prevent commits against the 'master' branch
if [[ `git rev-parse --abbrev-ref HEAD` == 'master' ]]
then
echo 'You cannot commit to the master branch!'
echo 'Stash your changes and apply them to another branch, using:'
echo 'git stash'
echo 'git checkout <branch>'
echo 'git stash apply'
@joaocunha
joaocunha / stylus-mixins-mdn.styl
Created December 11, 2014 22:07
Stylus Mixins used on the MDN Kuma project
@require 'vars';
@require 'prefixes';
/*
Provides man mixins for use within the MDN theme.
*/
/* searches expression for the provided string and replaces with provided value */
replace($expr, $str, $val) {
$expr = clone($expr);
@joaocunha
joaocunha / vars.styl
Created December 11, 2014 22:09
Stylus Vars used on the MDN Kuma project
/* vendors */
/* - this is a global variable set by stylus to 'moz webkit o ms official' by default
- as far as I can tell it only uses it for @keyframes
- and they're going to remove it in 1.0
- anyway, we get csslint errors if ms is in this list
*/
vendors = webkit official;
/* our custom variable for prefixing */
VENDOR-PREFIXES = '-webkit-' '-moz-' '-ms-';
/* custom list of properties and their valid prefixes for vendors we support */
@joaocunha
joaocunha / vunit_example.html
Last active February 4, 2016 18:58
vUnit.js example
<head>
<!-- Add vUnit.js to the head if you want to avoid FOUC -->
<script src="path/to/vunit.js"></script>
<!-- Instantiate vUnit.js passing a CSSMap with properties you want to play with -->
<script>
new vUnit({
CSSMap: {
// The selector (vUnit will create rules ranging from .selector1 to .selector100)
'.vh_height': {
#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
@joaocunha
joaocunha / makeapp.sh
Last active August 29, 2015 14:14 — forked from eerne/makeapp.sh
#!/bin/sh
echo "What should the Application be called (no spaces allowed e.g. GCal)?"
read inputline
name="$inputline"
echo "What is the url (e.g. https://www.google.com/calendar/render)?"
read inputline
url="$inputline"
@joaocunha
joaocunha / makeapp.sh
Last active August 29, 2015 14:14 — forked from eerne/makeapp.sh
#!/bin/sh
echo "What should the Application be called (no spaces allowed e.g. GCal)?"
read inputline
name="$inputline"
echo "What is the url (e.g. https://www.google.com/calendar/render)?"
read inputline
url="$inputline"
@joaocunha
joaocunha / .gitconfig
Last active August 29, 2015 14:14 — forked from L2G/.gitconfig
[url "git@github.com:L2G/"]
insteadOf = "github:///L2G/"
insteadOf = "http://github.com/L2G/"
insteadOf = "https://github.com/L2G/"
[url "https://github.com/"]
insteadOf = "github:///"
insteadOf = "http://github.com/"