Skip to content

Instantly share code, notes, and snippets.

View pikonha's full-sized avatar
🎧
learning in public

lucas picollo pikonha

🎧
learning in public
  • Blockful
  • Florianópolis, Santa Catarina, Brasil
  • 18:26 (UTC -03:00)
View GitHub Profile
@markodayan
markodayan / Example.js
Last active June 21, 2024 09:33
EIP-712 Signing
const ethUtil = require('ethereumjs-util');
const abi = require('ethereumjs-abi');
const chai = require('chai');
const typedData = {
types: {
EIP712Domain: [
{ name: 'name', type: 'string' },
{ name: 'version', type: 'string' },
{ name: 'chainId', type: 'uint256' },
@alexrios
alexrios / syllabus.md
Last active June 27, 2021 09:40
Go Concorrente

Go Concorrente

Intro

  • Concorrência
  • Scheduler
    • internals (semantics)
  • Deadlocks, Livelocks e starvation
  • O que é CSP?

Nivel 1

@dvinciguerra
dvinciguerra / free_games.rb
Last active June 8, 2021 01:03
Epic Games - Ruby script to fetch free games from website
require 'json'
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'faraday'
end
@threepointone
threepointone / feature-flags.md
Last active May 24, 2023 11:03
Feature flags: why, how, all that

(I'm enjoying doing these raw, barely edited writeups; I hope they're useful to you too)

Feature flags

This is my own writeup on feature flags; for a deep dive I'd recommend something like Martin Fowler's article (https://martinfowler.com/articles/feature-toggles.html).

So. Feature flags. The basic idea that you'll store configuration/values on a database/service somewhere, and by changing those values, you can change the user experience/features for a user on the fly.

Let's say that you're building a new feature, called 'new-button' which changes the color of buttons, which is currently red, to blue. Then you'd change code that looks like this -

" Specify a directory for plugins
call plug#begin('~/.vim/plugged')
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'scrooloose/nerdtree'
"Plug 'tsony-tsonev/nerdtree-git-plugin'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
Plug 'ryanoasis/vim-devicons'
Plug 'airblade/vim-gitgutter'
@sarmbruster
sarmbruster / run_docker_neo4j_bloom.sh
Last active June 25, 2024 18:40
Run Neo4j in a docker container together with apoc and Bloom installed.
#!/bin/sh
# start a neo4j docker container with apoc and bloom (server variant) configured
# this requires to have
# * curl, unzip and jq being installed
# * having a valid bloom license file
# released under the WTFPL (http://www.wtfpl.net/)
# (c) Stefan Armbruster
@dakait
dakait / decorators.go
Created August 29, 2018 12:02
Chaining handler functions with gin
//Golang doesn't have python-Django like decorators but here is
//a small example of what you can do
package main
import "github.com/gin-gonic/gin"
func Handler(h gin.HandlerFunc, decors ...func(gin.HandlerFunc)gin.HandlerFunc) gin.HandlerFunc {
for i := range decors {
@mbinna
mbinna / effective_modern_cmake.md
Last active July 25, 2024 18:43
Effective Modern CMake

Effective Modern CMake

Getting Started

For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.

After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft

@dmurawsky
dmurawsky / index.js
Last active May 22, 2024 19:01
How to make a page full height in Next.js
const FullHeightPage = () => (
<div>
Hello World!
<style global jsx>{`
html,
body,
body > div:first-child,
div#__next,
div#__next > div {
height: 100%;