Skip to content

Instantly share code, notes, and snippets.

View AgtLucas's full-sized avatar
🌎
💀⏳🌷

Lucas AgtLucas

🌎
💀⏳🌷
View GitHub Profile

Markdown and reStructuredText

GitHub supports several lightweight markup languages for documentation; the most popular ones (generally, not just at GitHub) are Markdown and reStructuredText. Markdown is sometimes considered easier to use, and is often preferred when the purpose is simply to generate HTML. On the other hand, reStructuredText is more extensible and powerful, with native support (not just embedded HTML) for tables, as well as things like automatic generation of tables of contents.

stopBefore.js

2min screencast

Examples

stopBefore(document, 'getElementById')
stopBefore('document.getElementById') // the same as the previous
stopBefore(Element.prototype, 'removeChild')
mymodule {
@at-root {
.#{&}-header { ... }
.#{&}-footer { ... }
.#{&}-body {
a { ... }
span { ... }
p { ... }
}
}

DocPad: Minify your assets with Grunt

The following will minify your assets with grunt each time a generation write completes.

Installation

  1. Install Dependencies
#!/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
var util = require('util'),
http = require('http'),
events = require('events');
var Twitter = function(opts) {
this.username = opts.username;
this.password = opts.password;
this.track = opts.track;
this.data = '';
};
@AgtLucas
AgtLucas / gist:6263457
Created August 18, 2013 19:21
Testing pjax
$(document).on('submit', 'form[data-pjax]', function(event) {
$.pjax.submit(event, '#pjax-container')
})
@AgtLucas
AgtLucas / gist:6320968
Last active December 21, 2015 14:39
Seam Framework presentation - 1
// Indica que a classe User é um Entity Bean
@Entity
// Um componente Seam, seu nome precisa ser unico dentro da aplicação
@Name("user")
// Sempre que o Seam instancia um componente, ele liga a nova instância a uma variável de contexto,
// nesse caso é um componente no escopo de sessão
@Scope(SESSION)
// Indica que a classe User é mapeada para a tabela users no BD
@Table(name="users")
public class User implements Serializable {
@AgtLucas
AgtLucas / gist:6321065
Created August 23, 2013 16:09
Seam Framework presentation - 2
@Stateless
@Name("register")
public class RegisterAction implements Register {
// Annotation que indica que o atributo foi injetado pelo Seam, neste caso, injetado de contexto user
@In
private User user;
// EJB3 entity manager
@PersistenceContext
{
"bitwise": true,
"eqeqeq": true,
"eqnull": true,
"immed": true,
"newcap": true,
"esnext": true,
"latedef": true,
"noarg": true,
"node": true,