This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const validBraces = (str) => ![...str].reduceRight(collapse, []).join('') | |
const collapse = ([head, ...tail], val) => { | |
switch (val) { | |
case '(': | |
return head === ')' ? tail : [val, head, ...tail] | |
case '{': | |
return head === '}' ? tail : [val, head, ...tail] | |
case '[': | |
return head === ']' ? tail : [val, head, ...tail] | |
default: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main exposing (Customer(..), calculateTotal) | |
type Customer | |
= Eligible { id : String } | |
| Registered { id : String } | |
| Guest { id : String } | |
calculateTotal : Customer -> Double -> Double |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function fish_greeting | |
echo ' '(set_color F00)'___ | |
___======____='(set_color FF7F00)'-'(set_color FF0)'-'(set_color FF7F00)'-='(set_color F00)') | |
/T \_'(set_color FF0)'--='(set_color FF7F00)'=='(set_color F00)') '(set_color red)(whoami)'@'(hostname)' | |
[ \ '(set_color FF7F00)'('(set_color FF0)'0'(set_color FF7F00)') '(set_color F00)'\~ \_'(set_color FF0)'-='(set_color FF7F00)'='(set_color F00)')'(set_color yellow)' Uptime:'(set_color white)(uptime | sed 's/.*up \([^,]*\), .*/\1/')(set_color red)' | |
\ / )J'(set_color FF7F00)'~~ \\'(set_color FF0)'-='(set_color F00)') Theme: '(set_color white)(echo $fish_theme)(set_color red)' | |
\\\\___/ )JJ'(set_color FF7F00)'~'(set_color FF0)'~~ '(set_color F00)'\) '(set_color yellow)'Version: '(set_color white)(echo $FISH_VERSION)(set_color red)' | |
\_____/JJJ'(set_color FF7F00)'~~'(set_color FF0)'~~ '(set_color F00)'\\ | |
'(set_color FF7F00)'/ '(set_color FF0)'\ '(set_color FF0)', \\'(set_color F00)'J'(set_color |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* | |
* 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Create an event emitter that goes like this | |
* emitter = new Emitter(); | |
* | |
* Allows you to subscribe to some event | |
* sub1 = emitter.subscribe('function_name', callback1); | |
* (you can have multiple callbacks to the same event) | |
* sub2 = emitter.subscribe('function_name', callback2); | |
* | |
* You can emit the event you want with this api |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# 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 |
NewerOlder