Skip to content

Instantly share code, notes, and snippets.

View fakenickels's full-sized avatar
💭
hello this is a mic test, are you listening

Gabriel Rubens Abreu fakenickels

💭
hello this is a mic test, are you listening
View GitHub Profile
@VictorTaelin
VictorTaelin / itt-coc.ts
Last active March 2, 2024 15:53
ITT-Flavored Calculus of Constructions Type Checker
// A nano dependent type-checker featuring inductive types via self encodings.
// All computation rules are justified by interaction combinator semantics,
// resulting in major simplifications and improvements over old Kind-Core.
// Specifically, computable annotations (ANNs) and their counterpart (ANN
// binders) and a new self encoding based on equality (rather than dependent
// motives) greatly reduce code size. A more complete file, including
// superpositions (for optimal unification) is available on the
// Interaction-Type-Theory repository.
// Credits also to Franchu and T6 for insights.

Idea

Reason is faster than JavaScript when using BuckleScript.

Why?

The way that you design APIs are different, JavaScript code and the lack of a type system leads to APIs being designed strictly for humans.

String as type identifier

@guilhermedecampo
guilhermedecampo / nubank-csv-web-downloader.md
Last active June 21, 2020 19:56
A better Nubank csv web downloader using chrome dev tools

Nicer CSV download of nubank data

Function

function downloadNubankCSV({ date }) {
  const transactions = angular.element(document.body).injector().get('Bills').all.map(bill => bill.more.line_items).flat()
  const regExp = new RegExp(date, 'g')
  const csv = transactions
 // filtering wanted/unwanted datapoints
@hew
hew / _readme.md
Last active April 29, 2019 19:32
Reason React Native Styled System (Beta)

Reason React Native Styled System (Beta)

@sibelius
sibelius / Sample.tsx
Created February 27, 2019 15:47
useRelayPagination to be used with React Native Flatlist
const {
isFetchingEnd,
isFetchingTop,
onRefresh,
onEndReached,
} = useRelayPagination(relay, users);
const isRefreshing = isFetchingEnd || isFetchingTop;
<FlatList
@LiveOverflow
LiveOverflow / AcoraidaMonicaGame.sol
Last active February 10, 2024 13:13
Acoraida Monica
pragma solidity =0.4.25;
contract AcoraidaMonicaGame{
uint256 public version = 4;
string public description = "Acoraida Monica admires smart guys, she'd like to pay 10000ETH to the one who could answer her question. Would it be you?";
string public constant sampleQuestion = "Who is Acoraida Monica?";
string public constant sampleAnswer = "$*!&#^[` a@.3;Ta&*T` R`<`~5Z`^5V You beat me! :D";
Logger public constant logger=Logger(0x5e351bd4247f0526359fb22078ba725a192872f3);
address questioner;
string public question;
// funciona somente com v3.1.6, essa estrategia de end/continue
// era um backdoor para fazer recursao em types, recursao funcionava somente com interfaces
// antigamente pela resolucao de tipos ser lazyness e nao acabar fazendo o compiler cair
// potencialmente em um looping infinito na resolucao do tipo, por causa disto tem validacao
// no compiler agora e codigos nesse estilo sao barrados pelo compiler
type Init<T extends any[], TTail extends any[] = TailArray<T>> = CastArray<{
[K in keyof TTail]: T[keyof T & K];
}>
#!/bin/bash
set -e
CONTENTS=$(tesseract -c language_model_penalty_non_dict_word=0.8 --tessdata-dir /usr/local/share/tessdata/ "$1" stdout -l eng | xml esc)
hex=$((cat <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
@WolfDan
WolfDan / reForm.re
Last active January 8, 2018 22:49
ReForm validation proposal
/* Source from: https://github.com/Astrocoders/reform I edited it to handle the onChange events and validation */
type action =
| HandleChange((string, string))
| HandleSubmit;
type validation =
| Required
| MinLength(int)
| MaxLength(int)
| Between(int, int)
@acdlite
acdlite / coordinating-async-react.md
Last active March 20, 2022 12:27
Demo: Coordinating async React with non-React views

Demo: Coordinating async React with non-React views

tl;dr I built a demo illustrating what it might look like to add async rendering to Facebook's commenting interface, while ensuring it appears on the screen simultaneous to the server-rendered story.

A key benefit of async rendering is that large updates don't block the main thread; instead, the work is spread out and performed during idle periods using cooperative scheduling.

But once you make something async, you introduce the possibility that things may appear on the screen at separate times. Especially when you're dealing with multiple UI frameworks, as is often the case at Facebook.

How do we solve this with React?