Skip to content

Instantly share code, notes, and snippets.

View FernandoVezzali's full-sized avatar

Fernando Ayrosa Vezzali FernandoVezzali

  • 08:23 (UTC -03:00)
View GitHub Profile
# prints 0-9
for x in range(10):
print x
# prints 1-10
for x in range(1, 11):
print x
# remember, we don't need to declare variables
# we can just assign them
@FernandoVezzali
FernandoVezzali / JS-LINQ.js
Created July 16, 2018 18:27 — forked from DanDiplo/JS-LINQ.js
JavaScript equivalents of some common C# LINQ methods. To help me remember!
// JS array equivalents to C# LINQ methods - by Dan B.
// Here's a simple array of "person" objects
var people = [
{ name: "John", age: 20 },
{ name: "Mary", age: 35 },
{ name: "Arthur", age: 78 },
{ name: "Mike", age: 27 },
{ name: "Judy", age: 42 },
{ name: "Tim", age: 8 }
@FernandoVezzali
FernandoVezzali / .gitconfig
Last active September 5, 2017 17:52 — forked from giggio/_latest.md
My .gitconfig and .gitattributes
[diff]
indentHeuristic = true
submodule = log
[color]
diff = always
interactive = always
status = always
branch = always
[alias]
st = status
public static int Largest(int[] list)
{
int index, max = Int32.MaxValue;
for (index = 0; index < list.Length - 1; index++)
{
if (list[index] > max)
{
max = list[index];
}
}
@FernandoVezzali
FernandoVezzali / 0_reuse_code.js
Last active August 29, 2015 14:12
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
<#@ template debug="false" hostspecific="true" language="C#" #>
<#@ output extension=".cs" #>
<#@ assembly name="System" #>
<#@ assembly name="System.Xml" #>
<#@ assembly name="System.Xml.Linq" #>
<#@ import namespace="System.IO" #>
<#@ import namespace="System.Xml.Linq" #>
<#@ import namespace="System.Collections.Generic" #>
// first install this NuGet package: Install-Package ftplib
static void Main(string[] args)
{
using (var tConn = new FtpConnection("00.000.00.000", "UserName", "Password"))
{
tConn.Open();
tConn.Login();
if (tConn.DirectoryExists("/www"))
@FernandoVezzali
FernandoVezzali / RequestBinExample.cs
Created December 18, 2013 06:11
RequestBinExample
using System;
using System.Net.Http;
using System.Threading.Tasks;
namespace RequestBinExample
{
class Program
{
static void Main(string[] args)
{
@FernandoVezzali
FernandoVezzali / MvcScaffolding_VS2013
Last active December 29, 2015 04:09
MVCScaffolding for MVC 5 (Visual Studio 2013)
Install-Package EntityFramework.SqlServerCompact -version 6.0.1
Install-Package MvcScaffolding -Version 1.0.8-vs2013 -Pre
public class Category {
public int CategoryId { get; set; }
public string Name { get; set; }
}
public class Product
{
@FernandoVezzali
FernandoVezzali / CustomRoute.cs
Last active December 26, 2015 09:59
Custom Route MVC
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "CustomRoute",
url: "{controller}/{action}/{startYear}/{startMonth}/{startDay}/{endYear}/{endMonth}/{endDay}",
defaults: new
{
controller = "Home",