Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home forever and ever

Max Claus Nunes maxcnunes

🏠
Working from home forever and ever
View GitHub Profile
@maxcnunes
maxcnunes / Aluno.cs
Created Feb 5, 2012
WindowsForm-Entidades-RepositorioAdoNet
View Aluno.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace MDI_Escola.Entidades
{
/// <summary>
/// Entidade Aluno
/// </summary>
@maxcnunes
maxcnunes / Debug-Knockout-JS.html
Last active Apr 26, 2019
Simple way to debug viewmodel data bind with knockout
View Debug-Knockout-JS.html
<pre data-bind="text: ko.toJSON($data, null, 2)"></pre>
View Bind-Element-From-Selected-Item-Knockout.html
<script type="text/javascript">
var viewModel = {
students: ko.observableArray([
{ id: 1, name: 'Jake' },
{ id: 2, name: 'Kate' },
{ id: 3, name: 'Mari' }
]),
selected: ko.observable()
};
@maxcnunes
maxcnunes / Get-Json-In-Javascript-From-Model.cshtml
Created Apr 2, 2013
Get the json converted from Model to be used on javascript in the View with Razor.
View Get-Json-In-Javascript-From-Model.cshtml
$(function () {
// Get Json ViewModel
var json_response = @Html.Raw(Json.Encode(Model));
});
@maxcnunes
maxcnunes / open-current-directory-on-windows-explorer.bat
Created Apr 7, 2013
Open current directory on Windows Explorer from PROMPT (command line)
View Open-a-Visual-Studio-Solution-from-a-Git-Alias-And-Navigate-to-Directory
alias open-my-project='cd "full/path/to/MySolutionFolder/" && start MySolution.sln /D .'
#example:
#alias open-mp='cd "C:/Users/max.nunes/Projects/myproject/" && start myproject.sln /D .'
@maxcnunes
maxcnunes / Change-Password-Type-to-Fix-Connection-With-Mysql-Connector.sql
Created Apr 13, 2013
Tip to fix the problems to connect on MySql: - Authentication with old password no longer supported, use 4.1 style passwords" - Arithmetic operation resulted in an overflow MySql DB connection open
View Change-Password-Type-to-Fix-Connection-With-Mysql-Connector.sql
SET SESSION old_passwords=0;
SET PASSWORD FOR my_user=PASSWORD('my_password');
@maxcnunes
maxcnunes / Error-Gemfile.lock-required.sh
Created May 30, 2013
Error : Gemfile.lock required. Please check it in.
View Error-Gemfile.lock-required.sh
maxcnunes@Max-Mint-Office-VM ~/Development/bravi-ideas $ git push heroku master
Counting objects: 218, done.
Compressing objects: 100% (189/189), done.
Writing objects: 100% (218/218), 108.27 KiB, done.
Total 218 (delta 66), reused 0 (delta 0)
-----> Ruby/NoLockfile app detected
!
! Gemfile.lock required. Please check it in.
!
@maxcnunes
maxcnunes / Capitalise.cs
Last active Dec 17, 2015
Capitalise just the first letter of the whole sentence
View Capitalise.cs
private string Capitalise(string str)
{
if(String.IsNullOrEmpty(str))
return string.Empty;
var firstLetter = string.Empty;
if(str.Length > 0)
firstLetter = Char.ToUpper(str[0]);
return (str.Length == 1) ? firstLetter : firstLetter + str.Substring(1).ToLower();
@maxcnunes
maxcnunes / Install-ZSH-shell-on-Ubuntu.sh
Created May 31, 2013
Instalar ZSH terminal e Oh My ZSH no Ubuntu
View Install-ZSH-shell-on-Ubuntu.sh
#Instalar ZSH:
sudo apt-get update && sudo apt-get install zsh
#Configurar oh-my-zsh:
wget –no-check-certificate https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O – | sh
#Tornar ZSH terminal padrão
chsh -s /bin/zsh
#Reinicie o ubuntu.
You can’t perform that action at this time.