Skip to content

Instantly share code, notes, and snippets.

View christophermoura's full-sized avatar

Christopher Moura christophermoura

View GitHub Profile
@christophermoura
christophermoura / All Posts
Last active September 17, 2015 00:36 — forked from philsturgeon/All Posts
Octopress iTunes Feed
---
layout: post
title: "Episode 3: ExpressionEngine StackExchange"
date: 2012-12-20 10:47
comments: true
filename: some-file-name-without-extension
length: 52409154
summary: ExpressionEngine Pro Anna Brown and Testing Hero Chris Hartjes join Ben Edmunds and Phil Sturgeon to discuss the recent rumblings in the ExpressionEngine community and the new EE StackExchange site. We talk about Inversion of Control (IoC), what it is, why its useful and how it's done.
---
@christophermoura
christophermoura / handle-missing-image.js
Last active August 29, 2015 14:27 — forked from murtaugh/handle-missing-image.js
If an image fails, what do we do? In my case, maybe I've already defined a backup (usually in the case of inline SVGs), so we should look for that first. If that fails, then we'll hide the image (or do whatever the context requires).
$('img').on('error', function(){
//console.log('img load failure: ' + $(this).attr('src'));
var fallback = $(this).attr('data-fallback');
if (typeof fallback !== 'undefined' && fallback !== false) {
$(this).attr('src', fallback);
@christophermoura
christophermoura / keyboard-controls.js
Last active August 29, 2015 14:27 — forked from murtaugh/keyboard-controls.js
Keyboard Controls
document.onkeydown = checkKey;
function checkKey(e) {
e = e || window.event;
if ((e.keyCode == '39') || (e.keyCode == '40')) { // right / down arrow
console.log('right / down');
@christophermoura
christophermoura / html5-boilerplate.html
Created May 17, 2015 02:55
A custom boilerplate HTML5 markup made with htmlshell
<!DOCTYPE html>
<!--[if lte IE 6]><html class="preIE7 preIE8 preIE9"><![endif]-->
<!--[if IE 7]><html class="preIE8 preIE9"><![endif]-->
<!--[if IE 8]><html class="preIE9"><![endif]-->
<!--[if gte IE 9]><!--><html><!--<![endif]-->
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>title</title>
<meta name="author" content="name">
@christophermoura
christophermoura / 0_reuse_code.js
Last active August 29, 2015 14:18
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
/*
POMODORO 0.2
by @erikaheidi
January 2015
LED STATES:
starts blue - idle. When the button is clicked, it starts a pomodoro working phase. LED will be a red "breathing" style.
After the time is done, it will change to GREEN (static) - indicating that the pomodoro was completed and now you should go to a PAUSE
When clicking the button, the PAUSE phase will start (GREEN "BREATHING"). It will turn to RED (static) when the pause is done, indicating that
a new WORKING phase should follow. When the button is clicked, starts over with the WORKING phase (RED breathing LED) :)
Clean Code - Martin
Code Complete - McConnell
Compilers - Aho
Computer Networks (5th Edition) - Tanenbaum
Design Patterns - Gamma, et al
Domain-Driven Design - Evans
Growing Object-Oriented Software, Guided by Tests - Freeman, et al
Introduction to Automata Theory, Languages, and Computation - Hopcroft
Purely Functional Data Structures - Okasaki
Refactoring - Fowler

Contract Killer 3

Revised date: 07/11/2012

Between us [company name] and you [customer name]

Summary:

We’ll always do our best to fulfil your needs and meet your expectations, but it’s important to have things written down so that we both know what’s what, who should do what and when, and what will happen if something goes wrong. In this contract you won’t find any complicated legal terms or long passages of unreadable text. We’ve no desire to trick you into signing something that you might later regret. What we do want is what’s best for both parties, now and in the future.

@christophermoura
christophermoura / gist:1209075
Created September 11, 2011 02:05 — forked from viniciusteles/gist:556029
Sete Atitudes para Hackear a Indústria de Software
Sete Atitudes para Hackear a Indústria de Software
By Klaus Wuestefeld
1) Torne-se excelente.
Seja realmente bom em alguma coisa. Não fique só choramingando ou
querendo progredir às custas dos outros. Não pense q pq vc sentou 4
anos numa faculdade ouvindo um professor falar sobre software q vc
sabe alguma coisa. Jogador de futebol não aprende a jogar bola tendo
# simple capistrano task for wordpress deploy
# just replace the content to fit your app path and names
# and run cap deploy:setup && cap deploy
# you can also run a cap wordpress:upload_config to copy the local config-sample.php to remote shared folder
# warning: this recipe don't create the database
# APP SETTINGS
set :application, "your_app_name"
set :domain_name , "yourdomain.com.br"