Skip to content

Instantly share code, notes, and snippets.

View maxcnunes's full-sized 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 February 5, 2012 21:42
WindowsForm-Entidades-RepositorioAdoNet
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 April 26, 2019 11:07
Simple way to debug viewmodel data bind with knockout
<pre data-bind="text: ko.toJSON($data, null, 2)"></pre>
<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 April 2, 2013 12:39
Get the json converted from Model to be used on javascript in the View with Razor.
$(function () {
// Get Json ViewModel
var json_response = @Html.Raw(Json.Encode(Model));
});
@maxcnunes
maxcnunes / open-current-directory-on-windows-explorer.bat
Created April 7, 2013 23:52
Open current directory on Windows Explorer from PROMPT (command line)
explorer .
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 April 13, 2013 15:30
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
SET SESSION old_passwords=0;
SET PASSWORD FOR my_user=PASSWORD('my_password');
@maxcnunes
maxcnunes / Error-Gemfile.lock-required.sh
Created May 30, 2013 05:16
Error : Gemfile.lock required. Please check it in.
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 December 17, 2015 22:49
Capitalise just the first letter of the whole sentence
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 14:32
Instalar ZSH terminal e Oh My ZSH no Ubuntu
#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.