Skip to content

Instantly share code, notes, and snippets.

View arcostasi's full-sized avatar
:octocat:
Hello World

Anderson Costa arcostasi

:octocat:
Hello World
View GitHub Profile
@arcostasi
arcostasi / wokwi-custom-chips-c-api.md
Last active March 29, 2022 22:23
Wokwi Custom Chips C API

Este documento descreve a C API em andamento para escrever chips personalizados para o simulador Wokwi.

Usando a API

Primeiro, certifique-se de incluir wokwi-api.h. Cada método externo que você declara deve ser encapsulado com a macro EXPORT (por exemplo, void EXPORT(my_method_name) (uint32_t arg) { ... }). O chip deve declarar um método chip_init. Este método será chamado para cada nova instância do chip. Se o chip possui algum estado interno, o chip_init deve alocar memória para o estado interno e retornar um ponteiro para esta memória. Este ponteiro será passado no primeiro argumento para qualquer ouvinte que você declarar (por exemplo, chip_pin_change). Para chip sem nenhum estado interno, basta retornar NULL.

Aqui está um exemplo de um arquivo de chip mínimo:

@arcostasi
arcostasi / git-core-filemode.md
Created October 28, 2019 13:06
How to set Git to ignore chmod changes

If you want a git repository to ignore permission changes (chmod),

type the following command into the Terminal while inside the git repository:

git config core.filemode false

It is usually possible to do this for all git repositories at once, instead of going one-by-one.

@arcostasi
arcostasi / settings.txt
Last active July 30, 2019 12:27
my-vscode-preferences-settings
{
// Color Theme: Dark (Visual Studio)
// Editor settings
"editor.fontFamily": "Fira Code",
"editor.fontSize": 18,
"editor.lineHeight": 24,
"editor.fontLigatures": true,
// Applies a visual signal to the left of the selected line.
"editor.renderLineHighlight": "gutter",
@arcostasi
arcostasi / freebsd-ports.txt
Last active July 29, 2016 01:58
Installing the FreeBSD Ports Tree
Installing the FreeBSD Ports Tree:
First, you need to download the source code for the ports needed with this command:
portsnap fetch extract
Upgrading pkg:
Next, you need to upgrade pkg, which is used to install ports and FreeBSD packages with the following command:
@arcostasi
arcostasi / npm.md
Last active July 27, 2016 12:08
How to use npm global without sudo on OSX

Checking Your Files When you are done, you should have a files that looks something like the following:

~/.npmrc prefix="${HOME}/.npm-packages"

~/.bashrc NPM_PACKAGES="${HOME}/.npm-packages"
NODE_PATH="$NPM_PACKAGES/lib/node_modules:$NODE_PATH"
PATH="$NPM_PACKAGES/bin:$PATH"

@arcostasi
arcostasi / signing.md
Last active July 20, 2016 18:14
How to automatically sign your Android apk using Ionic framework and Crosswalk

How to automatically sign your Android apk using Ionic framework and Crosswalk

During the development of CoolKids I discovered a simple trick that can be a great time saver when you are building your app using Ionic Framework and the Crosswalk web view.

In few steps you’ll be able to automate the production of release signed apks of your app, ready to be published on the Google Play Store.

If you are developing an hybrid mobile app using the awesome Ionic Framework and you are targeting the Android platform, I strongly suggest you to use the Crosswalk web view for your app.

@arcostasi
arcostasi / ntpdate.sh
Created June 30, 2016 17:20
Alterando Timezone do Linux e ajustando a hora automaticamente
Adicionar essa linha no .bash_profile
export TZ=America/Sao_Paulo
# Sincronizar a data e hora com o servidor ntp
> ntpdate -u -b bonehed.lcs.mit.edu
# ntpdate -u -b <servidor>
@arcostasi
arcostasi / git-push.md
Created March 15, 2016 17:34
Git push deployment in 7 easy steps.md
@arcostasi
arcostasi / post-receive
Created March 15, 2016 17:33
git automatic push post-receive
#!/bin/sh
# Application Name:
export DEPLOY_APP_NAME=`NOME DO APP`
# This is the root deploy dir.
export DEPLOY_ROOT="/usr/local/www/application_web"
# When receiving a new git push, the received branch gets compared to this one.
# If you do not need this, just add a comment
export DEPLOY_ALLOWED_BRANCH="master"
@arcostasi
arcostasi / xdebug.ini
Created March 15, 2016 16:15
xdebug php.in
[xdebug]
zend_extension=xdebug.so
xdebug.remote_enable=1
xdebug.remote_port=9000
xdebug.profiler_enable=0
xdebug.profiler_output_dir="/tmp"
xdebug.idekey= "PHPSTORM"
xdebug.remote_connect_back = 1
xdebug.max_nesting_level = 250