Skip to content

Instantly share code, notes, and snippets.

Avatar
🌊
数学者に俺は成る!

Flavio Corpa kutyel

🌊
数学者に俺は成る!
View GitHub Profile
View Autocomplete.scss
@use '_share/src/zindex' as zindex;
@use '_share/src/Platform2/colors' as P2Colors;
@use '_share/src/Platform2/Scrollbar/style' as Scrollbar;
@mixin autocomplete {
&--search-icon {
margin-left: -8px;
margin-right: -4px;
height: 32px;
}
View tournaments.js
const app = Application.currentApplication()
app.includeStandardAdditions = true
let Calendar = Application("Calendar")
const rounds = [
["Round 1", "12/26/2022 17:00"],
["Round 2", "12/27/2022 10:00"],
["Round 3", "12/27/2022 17:00"],
["Round 4", "12/28/2022 10:00"],
["Round 5", "12/28/2022 17:00"],
@kutyel
kutyel / part3.elm
Created Jul 13, 2022
Chapter 1 of Essential F# in Elm
View part3.elm
module Main exposing (Customer(..), calculateTotal)
type Customer
= Eligible { id : String }
| Registered { id : String }
| Guest { id : String }
calculateTotal : Customer -> Double -> Double
@kutyel
kutyel / fix-git.sh
Created Jan 4, 2022
FIX git history of former work emails 🤦‍♂️
View fix-git.sh
git filter-branch --env-filter '
OLD_EMAIL="flavio.corpa@47deg.com"
CORRECT_NAME="Flavio Corpa"
CORRECT_EMAIL="flaviocorpa@gmail.com"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
export GIT_COMMITTER_NAME="$CORRECT_NAME"
export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL"
fi
if [ "$GIT_AUTHOR_EMAIL" = "$OLD_EMAIL" ]
@kutyel
kutyel / event-emitter-copilot.js
Created Jul 14, 2021
Github Copilot passed the Facebook EventEmitter JavaScript test... Yikes!
View event-emitter-copilot.js
/**
*
* Create an event emitter that goes like this:
*
```javascript
const emitter = new Emitter();
```
Its instance allows you to subscribe to some event by passing a callback function
View snapview.elm
port module Main exposing (main)
import Browser
import Html exposing (Html, button, canvas, div, h1, h3, p, text)
import Html.Attributes exposing (class, height, id, width)
import Html.Events exposing (onClick)
port subscribeToVideoUpdates : () -> Cmd msg
@kutyel
kutyel / Optics.hs
Created Oct 9, 2020 — forked from robrix/Optics.hs
Optics via fused-effects
View Optics.hs
{-# LANGUAGE RankNTypes #-}
module Optics where
import Control.Category ((>>>))
import qualified Control.Category as Cat
import Control.Effect.Empty
import Control.Effect.NonDet hiding (empty)
import Control.Monad ((<=<))
-- riffing off of @serras’s post https://gist.github.com/serras/5152ec18ec5223b676cc67cac0e99b70
@kutyel
kutyel / Morse.hs
Last active Sep 1, 2020
Quick and dirty morse decoder in Haskell
View Morse.hs
module Codewars.Kata.DecodeMorse (decodeMorse) where
import Codewars.Kata.DecodeMorse.Preload (morseCodes)
import Data.List.Split (splitOn)
import Data.Map.Strict ((!))
decodeMorse :: String -> String
decodeMorse = unwords . filter (not . null) . map ((>>= (morseCodes!)) . words) . splitOn " "
@kutyel
kutyel / Main.elm
Last active Apr 15, 2020
Google Calendar Chart Web Component in Elm https://ellie-app.com/8B8tftGqV6Da1
View Main.elm
module Main exposing (main)
import Dict
import Html exposing (Html)
import Html.Attributes exposing (attribute, property)
import Json.Encode as Encode
main : Html msg
main =
Html.node "google-calendar"
[ attribute "type" "calendar"
@kutyel
kutyel / Mimimi.elm
Created Apr 13, 2020
Translator to mi mi mi in Elm! ~20 mins.
View Mimimi.elm
module Main exposing (..)
import Browser
import Html exposing (Html, div, h1, input, p, text)
import Html.Attributes exposing (placeholder)
import Html.Events exposing (onInput)
import Regex as R