Skip to content

Instantly share code, notes, and snippets.

View giggio's full-sized avatar
💭
Nada a perder.

Giovanni Bassi giggio

💭
Nada a perder.
View GitHub Profile
@giggio
giggio / ForeachTest.cs
Created April 22, 2012 15:49
Iterating over a dynamic list
using System.Collections;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace DynamicForeach
{
[TestClass]
public class ForeachTest
{
[TestMethod]
public void ForeachDynamicTest()
@giggio
giggio / teste.html
Created December 12, 2012 20:46
Teste de desempenho criado pelo Rogério Moraes de Carvalho
<!DOCTYPE html>
<html>
<head>
<title>Teste de processamento JavaScript</title>
<script type="text/javascript">
var somas = [];
var temposGastos = [];
var quantidadeCalculos = 3; // Quantidade de vezes que a soma será executada.
var quantidadeIteracoes = 10000000;
<html>
<head>
<style type="text/css">
.fonte {
font-family: "Eras ITC", "Eras Medium ITC", Arial, sans-serif;
font-size: 96px;
}
</style>
</head>
<body>
@giggio
giggio / aperf.csx
Last active January 27, 2016 17:04
C# Script testing "is" perf vs reflection
using System.Diagnostics;
using static System.Console;
interface IFoo { }
interface BaseBase { }
interface Base : BaseBase { }
class Foo : Base, IFoo { }
struct Bar : IFoo { }
struct Baz : IFoo { }
@giggio
giggio / backupPartition
Last active February 19, 2016 05:04
Backup sd card partitions
#!/bin/bash
echo deleting local files older than a week...
find /media/data/backup/* -mtime +7 -type f -delete
echo backuping up /dev/mmcblk0p1...
if [ ! -f /media/data/backup/$(date +%Y%m%d)_mmcblk0p1.img ]; then
dd if=/dev/mmcblk0p1 of=/media/data/backup/$(date +%Y%m%d)_mmcblk0p1.img
fi
echo backuping up /dev/mmcblk0p2...
@giggio
giggio / npm.cmd
Created February 2, 2016 16:54 — forked from mykohsu/npm.cmd
Alternative npm.cmd for VS201X node tools integration. Caches npm ls -g result until a different npm command is issued.
@ECHO OFF
SETLOCAL
SET "NODE_EXE=%~dp0\node.exe"
IF NOT EXIST "%NODE_EXE%" (
SET "NODE_EXE=node"
)
SET "NPM_CLI_JS=%~dp0\node_modules\npm\bin\npm-cli.js"
unidades = ['um', 'dois', 'tres', 'quatro', 'cinco', 'seis', 'sete', 'oito']
dezenas = ['dez', 'vinte']
centenas = ['cento']
class Letras:
def __init__(self, numero):
if numero > 100:
centena = int(numero / 100)
dezena = int((numero - (centena * 100))/ 10)
unidade = numero - (centena * 100) - (dezena * 10)
@giggio
giggio / install-docker-xenial.sh
Last active October 13, 2016 22:31
install-docker
#!/usr/bin/env bash
apt-get update
apt-get -y install apt-transport-https ca-certificates
apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" > /etc/apt/sources.list.d/docker.list
apt-get update
apt-get purge lxc-docker
apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual
apt-get install -y docker-engine
@giggio
giggio / solving_python_load_problem_in_vim_in_windows.md
Last active January 8, 2017 05:56
Solving python load problem in Vim in Windows

This is according to Bart on StackOverflow. I have tested it on Vim 8.0.118 and Python 2.7.11.

The error I was getting was:

Sorry, this command is disabled, the Python's site module could not be loaded.

If I wanted to check for python, with :echo has('python'), the answer was always 1.

@giggio
giggio / keybase.md
Created September 1, 2017 00:26
keybase.md

Keybase proof

I hereby claim:

  • I am giggio on github.
  • I am giggio (https://keybase.io/giggio) on keybase.
  • I have a public key whose fingerprint is A865 8915 939A B7E9 A74D E1F4 AE20 68D3 0CAD E67D

To claim this, I am signing this object: