Skip to content

Instantly share code, notes, and snippets.

Cleyton Ferrari cleytonferrari

Block or report user

Report or block cleytonferrari

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 about.js
(function () {
'use strict';
var app = angular.module('angularApp');
app.controller('aboutController', ['$scope', function ($scope) {
$scope.title = 'About App Template';
}]);
app.controller('helpController', ['$scope', function($scope) {
@cleytonferrari
cleytonferrari / trabalho001.md
Last active Aug 29, 2015
Trabalhos turma 2014.1 FAAr - TSI
View trabalho001.md

Trabalho 001

Criar um aplicativo ASP.Net MVC 5 usando o template Empty para realizar o cadastro de uma pessoa seguindo as regras abaixo:

Model

Criar um model chamado Pessoa com os seguintes campos:

Campo | Validação --- | --- | ---

View Documentation.md

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs
@cleytonferrari
cleytonferrari / cadastrar.html
Last active Aug 29, 2015
Exemplo de crud simples copiado e colado
View cadastrar.html
@using ExemploADOSimples.Controllers
@model ExemploADOSimples.Models.Cao
@{
ViewBag.Title = "Detalhe";
}
<div class="col-md-6">
<h2>Cadastrar</h2>
@Html.ValidationSummary()
<form action="" method="POST">
<fieldset>
@cleytonferrari
cleytonferrari / CaoAplicacao.cs
Last active Aug 29, 2015
Exemplo de classes para manipulacao de banco de dados, simples
View CaoAplicacao.cs
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Globalization;
using System.Linq;
using System.Web;
using ExemploADOSimples.Models;
using ExemploADOSimples.Repositorio;
namespace ExemploADOSimples.Aplicacao
@cleytonferrari
cleytonferrari / Program.cs
Created Jun 25, 2014
Abre um processo e fica monitorando, caso o processo seja finalizado ele volta a reabrir!
View Program.cs
using System;
using System.Diagnostics;
namespace MonitorCPU
{
class Program
{
public static void Main()
{
Monitorar();
@cleytonferrari
cleytonferrari / ClaimsController.cs
Created Sep 21, 2014
Exemplo de uso de roles através das Claims
View ClaimsController.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
using System.Web;
using System.Web.Mvc;
using Microsoft.AspNet.Identity;
using Microsoft.Owin;
using Microsoft.Owin.Security;
@cleytonferrari
cleytonferrari / AcessoController.cs
Created Nov 1, 2014
Exemplo de Login com Claims
View AcessoController.cs
public ActionResult Index(LoginViewModel model, string returnUrl)
{
if (!ModelState.IsValid) return View();
var usuario = autenticacaoAplicacao.UsuarioInformadoPodeLogarNoSistema(model.Login, model.Pass);
if (usuario != null)
{
Seguranca.SignInCookie(usuario);
View Seguranca.ca
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
using System.Web;
using Microsoft.AspNet.Identity;
using Microsoft.Owin;
using Microsoft.Owin.Security;
using W7Gestao.Dominio;
using W7Gestao.Dominio.Configuracao;
@cleytonferrari
cleytonferrari / formatar.js
Created Aug 9, 2012
Formatar moeda com Knockout JS
View formatar.js
//baseado em http://jsfiddle.net/digitalbush/R6MPU/
jQuery(function ($) {
function empenhoViewModel() {
var self = this;
self.valorTotal = ko.observable().dinheiro();
};
var format = function (value) {
if (value === '' || isNaN(value)) value = 0;
toks = Number(value).toFixed(2).replace('-', '').split('.');
You can’t perform that action at this time.