Skip to content

Instantly share code, notes, and snippets.

🌎
💀🌷

Lucas AgtLucas

🌎
💀🌷
Block or report user

Report or block AgtLucas

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View README.rst

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.

View Readme.md

stopBefore.js

2min screencast

Examples

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

DocPad: Minify your assets with Grunt

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

Installation

  1. Install Dependencies
View 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
View twitter_streaming.js
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 = '';
};
View gist:6263457
$(document).on('submit', 'form[data-pjax]', function(event) {
$.pjax.submit(event, '#pjax-container')
})
@AgtLucas
AgtLucas / gist:6320968
Last active Dec 21, 2015
Seam Framework presentation - 1
View gist:6320968
// 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 Aug 23, 2013
Seam Framework presentation - 2
View gist:6321065
@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
View .jshintrc
{
"bitwise": true,
"eqeqeq": true,
"eqnull": true,
"immed": true,
"newcap": true,
"esnext": true,
"latedef": true,
"noarg": true,
"node": true,
You can’t perform that action at this time.