Skip to content

Instantly share code, notes, and snippets.

View dimiro1's full-sized avatar

Claudemiro A F Neto dimiro1

  • Berlin, Germany
View GitHub Profile
var thing = 0;
function inc(param) {
param++;
}
inc(thing);
console.log(thing);
@dimiro1
dimiro1 / z80-test.go
Created November 14, 2015 02:38
A Simple Z80 Machine
package main
import (
"fmt"
"github.com/remogatto/z80"
)
type Memory struct {
memory []byte
}
@dimiro1
dimiro1 / Firefox-Developer.tmTheme
Created October 18, 2015 16:23
Firefox Dark colorscheme
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Firefox-Developer</string>
<key>settings</key>
<array>
<dict>
<key>settings</key>
{
"color_scheme": "Packages/Color Scheme - Default/Sunburst.tmTheme",
"draw_white_space": "all",
"folder_exclude_patterns":
[
".svn",
".git",
".hg",
"CVS",
".idea",
@dimiro1
dimiro1 / main.rb
Created May 25, 2015 23:56
Permutations Ruby
[2,3,5,6,7,9].permutation(3).map {|e| e.join.to_i % 5 == 0 }.count { |i| i == true }
@dimiro1
dimiro1 / main.py
Created May 25, 2015 23:56
Permutations Python
from itertools import permutations
sum(1 for i in [int(''.join(str(x) for x in e)) for e in permutations([2,3,5,6,7,9], 3)] if i % 5 == 0)

pyvenv-3.3 (Ubuntu 13.10, also Debian)

Symptoms

pyvenv-3.3 venvdir
venvdir/bin/python -c 'import sys; print(sys.path)'
# This should print the venvdir in sys.path.

But in buggy Ubuntu/Debian, it doesn't.

@dimiro1
dimiro1 / dc.c
Created December 24, 2014 12:53
Pequena implementação da calculadora "dc" do GNU/Linux
/***************************************************************************
* Pequena implementação da calculadora "dc" do GNU/Linux *
* Não é uma implementação para calculos de alta precisão *
* Copyright (C) 2009 by Claudemiro Alves Feitosa Neto *
* dimiro1@gmail.com *
* Modified: <2009-05-21 20:58:52 BRT> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
@dimiro1
dimiro1 / cpf.go
Last active August 29, 2015 14:11
Validador de CPF
package cpf
import (
"errors"
"strconv"
"strings"
)
var CpfInvalido = errors.New("Cpf Inválido")