Skip to content

Instantly share code, notes, and snippets.

View renatosousafilho's full-sized avatar

Renato Filho renatosousafilho

View GitHub Profile
@renatosousafilho
renatosousafilho / LOG FIREFOX
Created August 3, 2012 13:08
Aqui estão a página HTML, meu controller e meu modelo
[10:32:35.845] POST http://localhost:3000/contacts [HTTP/1.1 200 OK 224ms]
[10:32:35.858] ({readyState:0, setRequestHeader:(function (a, b) {if (!s) {var c = a.toLowerCase();a = m[c] = m[c] || a, l[a] = b;}return this;}), getAllResponseHeaders:(function () {return s === 2 ? n : null;}), getResponseHeader:(function (a) {var c;if (s === 2) {if (!o) {o = {};while ((c = bG.exec(n))) {o[c[1].toLowerCase()] = c[2];}}c = o[a.toLowerCase()];}return c === b ? null : c;}), overrideMimeType:(function (a) {s || (d.mimeType = a);return this;}), abort:(function (a) {a = a || "abort", p && p.abort(a), w(0, a);return this;}), done:(function () {if (c) {var a = c.length;n(arguments), j ? (l = c.length) : e && e !== !0 && (k = a, o(e[0], e[1]));}return this;}), fail:(function () {if (c) {var a = c.length;n(arguments), j ? (l = c.length) : e && e !== !0 && (k = a, o(e[0], e[1]));}return this;}), progress:(function () {if (c) {var a = c.length;n(arguments), j ? (l = c.length) : e && e !== !0 && (k = a, o(e[0], e[1]));}return th
@renatosousafilho
renatosousafilho / renderer.php
Created August 14, 2012 11:44
Alteração para renderizar apenas as categorias maiores na págiona inicial. Arquivo moodle/course/renderer.php
/**
* Renderers a category for use with course_category_tree
*
* @param array $category
* @param int $depth
* @return string
*/
//Aqui o parâmetro $depth passa a receber o valor 0(zero)
protected function course_category_tree_category(stdClass $category, $depth=0) {
$content = '';
require 'rubygems'
require 'sinatra'
require 'active_record'
require 'json'
ActiveRecord::Base.establish_connection(
:adapter => 'mysql2',
:database => 'autofood_web_development',
:username => 'root',
:password => 'root'
require 'rubygems'
require 'sinatra'
require 'sinatra/cross_origin'
require 'active_record'
require 'json'
require 'yajl'
require 'rack/cors'
ActiveRecord::Base.include_root_in_json = false
@renatosousafilho
renatosousafilho / package.json
Created February 8, 2013 12:24
Express-beginner
{
"name": "express-beginner",
"description": "Apllication to show how to begin with express",
"version": "0.0.1",
"dependencies": {
"express": "3.x"
}
}
$( document ).on("pageinit", function() {
var startX = 0;
document.addEventListener('touchstart', function(event) {
startX = event.touches[0].pageX;
}, false);
document.addEventListener('touchmove', function(event) {
event.preventDefault();
var distX = startX - event.touches[0].pageX;
console.log(distX);
@renatosousafilho
renatosousafilho / gist:5388748
Last active December 16, 2015 05:59
panel-slide-jquery.mobile
$( document ).on( "pageinit", "#demo-page" , function() {
var wrap = $(".ui-panel-content-wrap"),
panel = $(".ui-panel"),
originalPosition = 272,
position = "left",
startX = 0;
panel.on('panelbeforeopen', function(event){
position = $(event.currentTarget).panel("option", "position");
class VerificaNumeroPar {
int numero = "8"
if (numero%2==0) {
System.out.println("Nuḿero par");
} else {
System.out.println("Número impar");
}
}
<!DOCTYPE html>
<html>
<head>
<title>Apphotel</title>
<%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
<%= javascript_include_tag "application", "data-turbolinks-track" => true %>
<%= csrf_meta_tags %>
</head>
<body>
@renatosousafilho
renatosousafilho / 20140331025708_create_cashes.rb
Created March 31, 2014 12:08
Módulo de sistema de abertura e fechamento de caixa
class CreateCashes < ActiveRecord::Migration
def change
create_table :cashes do |t|
t.datetime :start_at
t.datetime :end_at
t.decimal :value_open
t.decimal :value_phisic_closed
t.decimal :value_system_closed
t.timestamps