Skip to content

Instantly share code, notes, and snippets.

View klaygomes's full-sized avatar
🚀

Cleiton Loiola klaygomes

🚀
View GitHub Profile
@klaygomes
klaygomes / test.js
Last active April 28, 2016 13:50
Requisitos: Dado um Schema inicial simples, aplicar funções de transformação em campos definidos pelo usuário.
'use strict';
var Schema = {
name: {
type: String
},
lastname: {
type: String
},
avatar: {

Lista todas as branchs que já foram merged

git branch -r --merged origin/master

Limpa todas as branchs que foram merged (apenas local)

git branch --merged master | grep -v "\* master" | xargs -n 1 git branch -d

Limpa todas as branchs que foram merged (origin)

git branch -r --merged origin/master | grep -v "\* master" | xargs -n 1 git push origin --delete

package main
import (
"encoding/csv"
"fmt"
"io"
"os"
"sort"
)
Process: ruby [14697]
Path: /usr/bin/ruby
Identifier: ruby
Version: 145.100.1
Code Type: ARM-64 (Native)
Parent Process: zsh [6051]
Responsible: iTerm2 [2166]
User ID: 501
PlugIn Path: /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.3/lib/ffi_c.bundle
@klaygomes
klaygomes / 05-led-roulette.rs
Last active May 26, 2022 22:12
Solution for discovery/microbit roulette challenge ( https://docs.rust-embedded.org/discovery/microbit/05-led-roulette/the-challenge.html ); It is able to rotate any matrix passed as parameter;
#![deny(unsafe_code)]
#![no_main]
#![no_std]
use cortex_m_rt::entry;
use microbit::{
board::Board,
display::blocking::Display,
hal::{prelude::*, Timer},
};
@klaygomes
klaygomes / gcc compiler optimization for arm systems.md
Created July 17, 2022 21:32 — forked from fm4dd/gcc compiler optimization for arm systems.md
GCC compiler optimization for ARM-based systems

GCC compiler optimization for ARM-based systems

2017-03-03 fm4dd

The gcc compiler can optimize code by taking advantage of CPU specific features. Especially for ARM CPU's, this can have impact on application performance. ARM CPU's, even under the same architecture, could be implemented with different versions of floating point units (FPU). Utilizing full FPU potential improves performance of heavier operating systems such as full Linux distributions.

-mcpu, -march: Defining the CPU type and architecture

These flags can both be used to set the CPU type. Setting one or the other is sufficient.

@klaygomes
klaygomes / snat_dnat_advantech.md
Created February 21, 2023 18:19 — forked from tomasinouk/snat_dnat_advantech.md
examples of SNAT, DNAT with iptables for Advantech, Conel routers, with comments (probably will work on other routers where iptables can be manipulated, care needs to be taken on applying these commands after reboot).

Some examples of SNAT, DNAT with iptables with comments

mainly used in start-up script

How to test 'safely'

When we play with iptables aka firewall we might end up in situation, where we execute rule, which has unforseen impact - lock yourself out. Recovering from this situation is necessity.

How to:

  • Enable reboot via SMS.
  • Test all commands in shell first before putting them into Start-up script. This way the command will be wiped out, when unit is rebooted.

masquarade all outgoing packets to be WLAN0 IP

92% sealing asset processing TerserPluginUnexpected token: punc ({) 13332 5646 undefined
{
text: '(self["webpackChunk_project"] = self["webpackChunk_project"] || []).push([[4314],{\n' +
'\n' +
'/***/ "../../node_modules/@storybook/addon-docs/dist/chunk-S4VUQJ4A.mjs":\n' +
'/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n' +
'\n' +
'"use strict";\n' +
'/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n' +
'/* harmony export */ r: () => (/* binding */ DocsRenderer)\n' +