Skip to content

Instantly share code, notes, and snippets.

Irakli Safareli safareli

Block or report user

Report or block safareli

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View threeCharCombine.purs
data Count = One | Two | ThreeOrMore
type Datum = { count :: Count, char :: Char }
data Stat = Stat (Array Datum)
instance semigroupCount :: Semigroup Count where
append One One = Two
append One _ = ThreeOrMore
append Two _ = ThreeOrMore
View SProxies.purs
-- | This is module defines modified version `SProxies` and `mkSProxies` from [here][Row] ([depending on this][Utils]).
-- | That code was licensed with [Apache License 2.0][License]
-- |
-- | [Row] - https://github.com/thomashoneyman/purescript-halogen-formless/blob/55e2453f8e0d9169ec3cdccdd8cc09c0e289ffea/src/Formless/Transform/Row.purs#L61-L100
-- | [Utils] - https://github.com/thomashoneyman/purescript-halogen-formless/blob/55e2453f8e0d9169ec3cdccdd8cc09c0e289ffea/src/Formless/Internal/Transform.purs#L23-L35
-- | [License] - https://github.com/thomashoneyman/purescript-halogen-formless/blob/55e2453f8e0d9169ec3cdccdd8cc09c0e289ffea/LICENSE
module Type.SProxies
( SProxies
, SProxies'
, mkSProxies
@safareli
safareli / Try2.purs
Last active Apr 12, 2019 — forked from paulvictor/Try2.purs
Using a dictionary to decide a runtime implementation
View Try2.purs
module Try2 where
import Prelude
import Control.Monad.Rec.Class (forever)
import Data.Tuple (uncurry)
import Data.Tuple.Nested ((/\), type (/\))
import Effect (Effect)
import Effect.Aff (Aff, launchAff)
import Effect.Class (liftEffect)
View keybase.md

Keybase proof

I hereby claim:

  • I am safareli on github.
  • I am safareli (https://keybase.io/safareli) on keybase.
  • I have a public key ASCnE0_lExjtbFI8yipNyuIMZMkKpOKIvRoy4_ePSSE1gAo

To claim this, I am signing this object:

@safareli
safareli / untilNextAnimationFrame.purs
Created Feb 27, 2019
performs delay untill next animation frame using requestAnimationFrame
View untilNextAnimationFrame.purs
-- | performs delay untill next animation frame.
untilNextAnimationFrame :: Aff Unit
untilNextAnimationFrame = do
var <- AVar.empty
w <- liftEffect $ window
Aff.bracket
(liftEffect $ requestAnimationFrame (launchAff_ $ AVar.put unit var) w)
(\requestAnimationFrameId -> liftEffect $ cancelAnimationFrame requestAnimationFrameId w)
(\_ -> AVar.take var)
View flac_to_alac.sh
FMT=flac
# Create identical directory structure under new "alac" folder
find . -type d | while read d; do
mkdir -p "alac/$d"
done
find . -name "*$FMT" | sort | while read f; do
ffmpeg -i "$f" -acodec alac -vn "alac/${f[@]/%$FMT/m4a}" < /dev/null;
FDIR=`dirname "$f"`;
if [ -f "${FDIR}/cover.jpg" ]
@safareli
safareli / FoldableExists.js
Created Oct 8, 2018
Example of Data.Exists like encoding of existentials with TypeClass constraints
View FoldableExists.js
"use strict";
var Control_Category = require("../Control.Category");
var Data_Foldable = require("../Data.Foldable");
var Data_Monoid = require("../Data.Monoid");
var Prelude = require("../Prelude");
var Unsafe_Coerce = require("../Unsafe.Coerce");
var runFoldableExists = function (f) {
return function (e) {
return e(function (dictFoldable) {
return f(dictFoldable);
View ProBus.purs
module Control.Monad.Aff.ProBus where
import Prelude
import Control.Monad.Aff (Error, forkAff)
import Control.Monad.Aff.Bus (BusR, BusR', BusRW, BusW, BusW')
import Control.Monad.Aff.Bus as Bus
import Control.Monad.Aff.Class (class MonadAff, liftAff)
import Control.Monad.Eff.AVar (AVAR)
import Control.Monad.Eff.Class (class MonadEff, liftEff)
View .cache_00c428db6aba4e1372ba1a5f5c9e31b8.json
{"dependencies":[{"name":"/Users/safareli/dev/foam/parcel-test/.sassrc.js","includedInParent":true,"mtime":1525365496252}],"generated":{"css":".A {\n color: black; }\n","js":""},"hash":"1721b8da4debc4bba73c21e436027add","cacheData":{}}
You can’t perform that action at this time.