Skip to content

Instantly share code, notes, and snippets.

View renatorib's full-sized avatar

Renato Ribeiro renatorib

View GitHub Profile
@renatorib
renatorib / operator_with_ligatures.md
Last active January 11, 2024 06:45
Using Operator Mono with Fira Code ligatures in Atom.

Using Operator Mono with Fira Code ligatures in Atom.

  1. Open your Atom's Stylesheet
    image

  2. Put this css

atom-text-editor {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
@renatorib
renatorib / vscode.settings.json
Created November 14, 2023 16:23
Tailwind classRegex vscode
"tailwindCSS.experimental.classRegex": [
// const foo = cn("...")
// const foo = cx("...")
// const foo = classnames("...")
["cn|cx|classnames\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"],
// <Component classNames={{ foo: "..." }} />
["classNames=\\{([^}]*)\\}", "[\"'`]([^\"'`]*).*?[\"'`]"],
// const foo = /* tw */ "..."
["/\\* tw \\*/ ?(.*)", "[\"'`]([^\"'`]*).*?[\"'`]"],
// const foo = /* tw */ { bar: "...", baz: "..." }
@renatorib
renatorib / readme.md
Last active October 13, 2023 17:17
Slack Block Kit Json Schema

Slack Block Kit Json Schema

Open schema raw file

Schema extracted from https://a.slack-edge.com/bv1-6-8cacda2/block-kit-builder.93ca53691de7cf9d4417.min.js
Probably the url/bundle will change every deploy so you might want to go https://api.slack.com/tools/block-kit-builder, open devtools and search for that file (block-kit-builder) in source tab. Pass some unminify tool and search for "JSON Schema".

PS1: Some block/element types simply does not work, idk why.
PS2: If you want to explore easily, copy the code and paste to the devtools console.

@renatorib
renatorib / App.js
Created February 8, 2023 16:54
My first Sandpack snippet from Gist
import './index.css';
export default function App() {
return <h1>Hello from Gist</h1>;
};
@renatorib
renatorib / fb_connect.php
Last active November 16, 2021 14:47
Implementação do Facebook PHP SDK e Login URL
<?php
//primeiro você chama o sdk do facebook
require 'facebook-php-sdk-master/src/facebook.php';
//aqui você instancia com as informações do seu app (tem que criar um app em developers.facebook.com)
$facebook = new Facebook(array(
'appId' => 'YOUR_APP_ID',
'secret' => 'YOUR_APP_SECRET'
));
?>
export const formatDate = (dateOrString, opts) => {
const date = new Date(dateOrString);
return new Intl.DateTimeFormat('pt-BR', opts).format(date);
}
@renatorib
renatorib / mini-ramda.js
Last active April 22, 2020 05:04
mini-ramda
export const uncurry = (fn) => (...args) => {
let result = fn
for(i in args){
result = typeof result === 'function'
? result(args[i])
: result
}
return result
}
@renatorib
renatorib / fibonacci.php
Last active February 20, 2020 17:10
Função em php que gera a Sequência de Fibonacci
<?php
/**
* Sequência de Fibonacci em PHP
* @author Renato Ribeiro <renato@lugri.com>
*
*/
//função que gera a sequência de fibonacci e retorna em array
function fibonacci($q, $zero = false){
if($q >= 2){
@renatorib
renatorib / readme.md
Last active July 22, 2019 22:47
tgit

New working branch (feature, bug, etc)

tgit new fs/xyz [-b master]

git checkout master               # ensure we are on master branch  
git pull origin master --rebase   # ensure master is up to date (fetch upstream && rebase)
git checkout -b fs/xyz            # create the new src branch  
git push -u origin @              # should we auto push new src branches to remote?

I. Should we auto push new src branches to remote? Maybe a opt-in flag?

@renatorib
renatorib / test.jstc
Last active July 13, 2019 04:36
some js type check
type ActionsBlock = {
!type: 'actions'
!elements: [
| StaticSelectElement
| UsersSelectElement
# | ConversationsSelectElement
# | ChannelsSelectElement
# | ButtonElement
# | OverflowElement
# | DatepickerElement