Skip to content

Instantly share code, notes, and snippets.

View diegorv's full-sized avatar

Diego Rossini diegorv

View GitHub Profile
bind "F10" "amx_on; amx_say random [ Desbugando ];amx_rcon sv_timeout 1;wait;wait;wait;wait;wait;amx_rcon sv_timeout 99999; amx_rcon sv_timeout 65;amx_execall speak buttons/button1;speak buttons/button1"
bind "F7" "amx_rcon sv_restart 1"
bind "F6" "amx_say [Cpl Off]; amx_rcon mp_friendlyfire 0; amx_rcon mp_startmoney 16000; amx_rcon mp_roundtime 2.50; amx_rcon mp_c4timer 35; amx_rcon mp_freezetime 0; amx_rcon mp_buytime 2.50; amx_rcon mp_timeleft 0; amx_rcon mp_timelimit 0; amx_rcon mp_maxrounds 0; amx_rcon sv_alltalk 0; amx_rcon mp_forcechasecam 0; amx_rcon mp_forcecamera 0; amx_rcon mp_autoteambalance 0; amx_rcon mp_limitteams 0; mp_autokick 1"
bind "F5" "amx_say [Cpl On]; amx_rcon mp_freezetime 15;amx_rcon mp_c4timer 35;amx_rcon mp_maxrounds 0;amx_rcon mp_tkpunish 0;amx_rcon mp_startmoney 800;amx_rcon mp_friendlyfire 1;amx_rcon mp_roundtime 1.75;amx_rcon mp_limitteams 0;amx_rcon mp_autoteambalance 0;amx_rcon mp_friendlyfire 1;amx_rcon allow_spectators 1;amx_rcon sv_alltalk 0;amx_rcon mp_forcecamera 2;amx_r
// Programa: Web Server com modulo ESP8266
// Alteracoes e adaptacoes: FILIPEFLOP
#include "ESP8266.h"
#include "SoftwareSerial.h"
// Cria uma serial nas portas 2 (RX) e 3 (TX)
SoftwareSerial esp8266(2 , 3);
// Define que o modulo ira utilizar a serial minhaSerial
class PasteController < ApplicationController
before_filter :last_pastes
private
def last_pastes
@last_pastes = Paste.last_pastes
end
public
class PasteController < ApplicationController
before_filter :last_pastes
private
def last_pastes
@last_pastes = Paste.last_pastes
end
public
# Allow the metal piece to run in isolation
require(File.dirname(__FILE__) + "/../../config/environment") unless defined?(Rails)
class Poller
def self.call(env)
if env["PATH_INFO"] =~ /^\/poller/
@posts = Post.find(1, :select => "title")
[200, {"Content-Type" => "text/html"}, @posts.title]
else
[404, {"Content-Type" => "text/html"}, ["Not Found"]]
# Allow the metal piece to run in isolation
require(File.dirname(__FILE__) + "/../../config/environment") unless defined?(Rails)
class Poller
def self.call(env)
if env["PATH_INFO"] =~ /^\/poller/
@post = Post.find(1)
[200, {"Content-Type" => "text/html"}, @post.title]
else
[404, {"Content-Type" => "text/html"}, ["Not Found"]]
require(File.dirname(__FILE__) + "/../../config/environment") unless defined?(Rails)
class Poller
def self.call(env)
if env["PATH_INFO"] =~ /^\/poller/
@post = Post.find(1)
ActiveRecord::Base.clear_active_connections!
[200, {"Content-Type" => "text/html"}, @post.title]
else
[404, {"Content-Type" => "text/html"}, ["Not Found"]]
map.resources :editions, :as => "edicao" do |edition|
edition.resources :categories, :as => "caderno" do |category|
category.resources :articles, :as => "artigo" do |article|
article.resources :article_comments, :as => "comentarios"
article.resources :article_ratings, :as => "ratings"
end
end
end
class Article < ActiveRecord::Base
has_permalink :title
belongs_to :category
has_attached_file :image, :styles => { :thumb => "100x100>" }
def to_param
"#{permalink}"
end
class TodosController < ApplicationController
helper :todos
skip_before_filter :login_required, :only => [:index, :calendar]
prepend_before_filter :login_or_feed_token_required, :only => [:index, :calendar]
append_before_filter :init, :except => [ :destroy, :completed, :completed_archive, :check_deferred, :toggle_check, :toggle_star, :edit, :update, :create, :calendar ]
append_before_filter :get_todo_from_params, :only => [ :edit, :toggle_check, :toggle_star, :show, :update, :destroy ]
session :off, :only => :index, :if => Proc.new { |req| is_feed_request(req) }