This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #encoding: utf-8 | |
| module Atendente::AgendaHelper | |
| def calendar(options={}, &block) | |
| caption = String.new | |
| contents = String.new | |
| head = String.new | |
| rows = String.new | |
| options = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Controller | |
| <?php | |
| class BannersController extends AppController { | |
| var $name = 'Banners'; | |
| var $uses = array('Banner'); | |
| var $paginate = array(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function($) { | |
| $.fn.poll = function(options){ | |
| var $this = $(this); | |
| var opts = $.extend({}, $.fn.poll.defaults, options); | |
| setInterval(update, opts.interval); | |
| function update(){ | |
| $.ajax({ | |
| type: opts.type, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| context "should validate presence of country fields if country not equal BRASIL" do | |
| before do | |
| Country.stub!(:find).with(2).and_return({:id => 2, :name => "ARGENTINA",:created_at => Time.now , :updated_at => Time.now}) | |
| end | |
| it { should validate_presence_of :year_of_arrival } | |
| it { should validate_presence_of :passport } | |
| it { should validate_presence_of :type_visa } | |
| it { should validate_presence_of :validity_visa } | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController | |
| def method_missing(provider) | |
| if !User.omniauth_providers.index(provider).nil? | |
| #omniauth = request.env["omniauth.auth"] | |
| omniauth = env["omniauth.auth"] | |
| if current_user #or User.find_by_email(auth.recursive_find_by_key("email")) | |
| current_user.user_tokens.find_or_create_by_provider_and_uid(omniauth['provider'], omniauth['uid']) | |
| #flash[:notice] = "Authentication successful" | |
| redirect_to edit_user_registration_path |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Disable menu bar transparency | |
| defaults write NSGlobalDomain AppleEnableMenuBarTransparency -bool false | |
| # Show remaining battery time; hide percentage | |
| defaults write com.apple.menuextra.battery ShowPercent -string "NO" | |
| defaults write com.apple.menuextra.battery ShowTime -string "YES" | |
| # Always show scrollbars | |
| defaults write NSGlobalDomain AppleShowScrollBars -string "Always" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def rescue_action_in_public(exception) | |
| if exception | |
| deliverer = self.class.exception_data | |
| data = case deliverer | |
| when nil then {} | |
| when Symbol then send(deliverer) | |
| when Proc then deliverer.call(self) | |
| end | |
| ExceptionNotifier.deliver_exception_notification(exception, self,request, data) | |
| flash[:error] = "Blah";redirect_to '/' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| if ( function_exists( 'add_theme_support' ) ) { | |
| add_theme_support( 'post-thumbnails' ); | |
| } | |
| function remove_footer_admin () { | |
| echo 'Carnabral 2012.'; | |
| } | |
| function change_footer_version() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $app->post('/estabelecimento/categoria/:id/update', function ( $id ) use ( $app ) { | |
| $params = $app->request->params(); | |
| $header = array('Content-Type: multipart/form-data'); | |
| $token = key( $_SESSION['current_user'] ); | |
| $current_user = json_decode( $_SESSION['current_user'][$token] ); | |
| if ( isset( $_FILES ) and isset( $_FILES['imagem'] ) ): | |
| $params['imagem'] = '@'.$_FILES['imagem']['tmp_name']; | |
| endif; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| server { | |
| listen 80; | |
| server_name iphoneria.rubert.com.br; | |
| client_max_body_size 500M; | |
| location / { | |
| root /usr/share/nginx/www/iphoneria; | |
| access_log /var/log/nginx/iphoneria.rubert.com.br.domain_access.log; |