Skip to content

Instantly share code, notes, and snippets.

@casimiroarruda
casimiroarruda / build.xml
Created February 28, 2012 01:59
Arquivo de configuração para o phing
<?xml version="1.0" encoding="UTF-8"?>
<project name="TheProject" default="build" basedir=".">
<!-- Altere estas propriedades adequando-as ao seu projeto -->
<property name="application.library" value="${project.basedir}/library"/>
<property name="application.tests" value="${project.basedir}/tests"/>
<property name="application.builddir" value="${project.basedir}/build"/>
<target name="build"

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@eddarmitage
eddarmitage / InstallingGitUsingYum.md
Created March 8, 2012 14:03
Installing git on CentOS 5 using yum

Installing git on CentOS 5 using yum

Since you're using CentOS 5, the default package manager is yum, not apt-get. To install a program using it, you'd normally use the following command:

$ sudo yum install <packagename>

However, when trying to install git this way, you'll encounter the following error on CentOS 5:

@danielestevez
danielestevez / gist:2044589
Last active December 11, 2024 17:46
GIT Commit to an existing Tag
1) Create a branch with the tag
git branch {tagname}-branch {tagname}
git checkout {tagname}-branch
2) Include the fix manually if it's just a change ....
git add .
git ci -m "Fix included"
or cherry-pick the commit, whatever is easier
git cherry-pick {num_commit}
@mikeygee
mikeygee / 01-before.html
Created May 7, 2012 07:45
truncate blog posts in jekyll
<!-- using the truncate filter -->
{% for post in site.posts limit:10 %}
<h2><a href="{{ post.url }}">{{ post.title }}</a></h2>
<span class="post-date">{{ post.date | date: "%B %d, %Y" }}</span>
{% if post.content.size > 2000 %}
{{ post.content | truncatewords: 300 }} <!-- bad! content gives you rendered html and you will truncate in the middle of a node -->
<a href="{{ post.url }}">read more</a>
{% else %}
{{ post.content }}
{% endif %}
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active December 20, 2024 15:04
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@carlosfilho88
carlosfilho88 / nginx.conf
Last active October 6, 2015 12:48
Zend with nginx
## Force redirect to www address
server {
server_name zf.local;
rewrite ^(.+?)/?$ http://www.zf.local$1 permanent;
}
server {
listen 80;
server_name www.zf.local;
index index.php;
@mauricioaniche
mauricioaniche / gist:3024328
Created June 30, 2012 15:55
Exercícios utilizados no estudo sobre TDD (SBES2012)
\chapter{Exercícios}
\label{ape:exercicios}
Os exercícios são os mesmos para todos os grupos. O participante, em caso de dúvidas, poderá perguntar ao pesquisador.
\section{Lembrete ao participante}
Caro participante,
Lembre-se que os problemas aqui propostos simulam complicações do mundo real.
@niallo
niallo / gist:3109252
Created July 14, 2012 04:54
Parse Github `Links` header in JavaScript
/*
* parse_link_header()
*
* Parse the Github Link HTTP header used for pageination
* http://developer.github.com/v3/#pagination
*/
function parse_link_header(header) {
if (header.length == 0) {
throw new Error("input must not be of zero length");
}
@Mithrandir0x
Mithrandir0x / gist:3639232
Created September 5, 2012 16:15
Difference between Service, Factory and Provider in AngularJS
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"