Skip to content

Instantly share code, notes, and snippets.

View rafaelcn's full-sized avatar
🎯
Work work

Rafael Campos Nunes rafaelcn

🎯
Work work
View GitHub Profile

Falsehoods programmers believe about prices

  1. You can store a price in a floating point variable.
  2. All currencies are subdivided in 1/100th units (like US dollar/cents, euro/eurocents etc.).
  3. All currencies are subdivided in decimal units (like dinar/fils)
  4. All currencies currently in circulation are subdivided in decimal units. (to exclude shillings, pennies) (counter-example: MGA)
  5. All currencies are subdivided. (counter-examples: KRW, COP, JPY... Or subdivisions can be deprecated.)
  6. Prices can't have more precision than the smaller sub-unit of the currency. (e.g. gas prices)
  7. For any currency you can have a price of 1. (ZWL)
  8. Every country has its own currency. (EUR is the best example, but also Franc CFA, etc.)
@ryukinix
ryukinix / mano.el
Last active August 3, 2017 07:34
A collection of useful macros in Emacs Lisp
;;; mano.el -- useful macros made by me, Manoel
;; Copyright © 2017 Manoel Vilela
;;
;; Author: Manoel Vilela <manoel_vilela@engineer.com>
;; URL: https://github.com/ryukinix/dotfiles
;; Version: 1.0.0
;; Keywords: convenience
;; This file is not part of GNU Emacs.
@ryukinix
ryukinix / matrix.c
Last active August 23, 2017 19:09
Diferenças entres tipos de alocação dinâmica de matrizes em C
/**
* Copyright 2017 Manoel Vilela
*
* Referências da Aula_0 e Aula_1.
*/
// Nós temos duas maneiras de lidar com matrizes
// e alocação dinâmica.
// Uma matriz pode ser representada como um conjunto de n
@mrkrndvs
mrkrndvs / export-named-sheet-as-csv.gs
Last active July 3, 2024 06:54 — forked from mderazon/export-to-csv.gs
Google apps script to export an individual sheet as csv file
/*
* script to export data of the named sheet as an individual csv files
* sheet downloaded to Google Drive and then downloaded as a CSV file
* file named according to the name of the sheet
* original author: Michael Derazon (https://gist.github.com/mderazon/9655893)
*/
function onOpen() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var csvMenuEntries = [{name: "Download Primary Time File", functionName: "saveAsCSV"}];

tldr: go build only produces an executable for main packages. Check the package name of your main file is main.

I am an idiot. Its only through mistakes that you learn tho. I have recently been running into issues with my new golang projects. ONLY the new ones. Whenever I try to make a new project, it would always have issues. The biggest issue is the fact that "go build" would not produce an executable without "-o main.exe" as arguments. When an executable was produced, if I ran it I got

$ ./main.exe
./main.exe: line 1: syntax error near unexpected token \`newline\'
./main.exe: line 1: \`!<arch>\'