Skip to content

Instantly share code, notes, and snippets.

View vrom911's full-sized avatar
🦄

Veronika Romashkina vrom911

🦄
View GitHub Profile
@leroix
leroix / check-remote-sync.sh
Created February 5, 2014 18:15
Git: check if a branch is sync'd with a branch of the same name in a remote repo e.g. `check-remote-sync development origin`. Returns nothing if in sync.
#!/bin/bash
LOCAL_BRANCH=$1
REMOTE_BRANCH="${2:-origin}/$1"
if [ x"$(git rev-parse $LOCAL_BRANCH)" != x"$(git rev-parse $REMOTE_BRANCH)" ]
then
echo "$LOCAL_BRANCH is not in sync with $REMOTE_BRANCH. You may want to rebase or push first."
fi
@wh1tney
wh1tney / deploy-static-site-heroku.md
Last active May 25, 2024 22:28
How to deploy a static website to Heroku

Gist

This is a quick tutorial explaining how to get a static website hosted on Heroku.

Why do this?

Heroku hosts apps on the internet, not static websites. To get it to run your static portfolio, personal blog, etc., you need to trick Heroku into thinking your website is a PHP app. This 6-step tutorial will teach you how.

Basic Assumptions

@saurabhnanda
saurabhnanda / haskell-interhsip.md
Last active November 18, 2018 15:42
Haskell Internship Bounty Program

Attention

This page has been moved to http://www.vacationlabs.com/haskell-bounty-program

Haskell Internship Bounty Program

Here's the general idea:

  • Solve a pre-defined problem (could be an open source contribution OR an internal tool) for a bounty (basically success-fee). Not looking at GSoC level funding or problems, but something that can be done in 1-2 weeks with a 50-250$ bounty.
  • Supported by mentoring and general help over slack/IRC.
@chshersh
chshersh / ArrayFun.hs
Last active August 15, 2019 05:27
Emulating array syntax with lens
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE ViewPatterns #-}
-- | This module contains some approach for emulating array syntax from
-- imperative languages. The approach emulates only syntax, not efficiency.
-- Though if you like working with persistent arrays it may be good for you.
-- Also it's a fun exercise on lenses.
@chshersh
chshersh / ghci.conf
Last active December 5, 2023 00:19
Config for GHCi with pretty output
-- To run:
-- cabal repl -b pretty-simple
--
-- Colorizing and pretty-printing ghci output
-- requires: pretty-simple
:set -interactive-print=Text.Pretty.Simple.pPrint
-- green bold lambdas and multiline mode
:set prompt "\ESC[1;32mλ: \ESC[m"
:set prompt-cont "\ESC[1;32mλ| \ESC[m"
@chshersh
chshersh / parser-combinators-vs-parser-generators.md
Last active June 4, 2024 13:27
Per criterion comparison of Parser Generators and Parser Combinators

Legend:

  • ➖ poor (impossible or very hard to achieve)
  • ➕ good (possible but requires some dancing)
  • ✔️ excellent (very easy to achieve/have)

PC stands for parser combinators and PGparser generators.

Property Generators Combinators Description
Power ✔️ LALR ➕ LL(∞) PC can't handle left-recursive grammars (though, there's some article¹...).
@chshersh
chshersh / Comonad.hs
Created March 25, 2019 11:07
Comonadic builders
#!/usr/bin/env cabal
{- cabal:
build-depends:
, base ^>= 4.12.0.0
, comonad ^>= 5.0
, pretty-simple ^>= 2.2
, text
-}
{-# LANGUAGE OverloadedStrings #-}
@chshersh
chshersh / TypeError.hs
Last active July 15, 2019 06:53
Examples of custom type errors
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE InstanceSigs #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE UndecidableInstances #-}
@ChrisPenner
ChrisPenner / Optics Cheatsheet.md
Last active April 12, 2024 14:24
Optics Cheatsheet
@graninas
graninas / haskell_design_patterns.md
Last active May 11, 2024 12:56
Haskell Design Patterns

Design patterns in Haskell

This is a list of patterns. I'm collecting this list with an idea to write a book similar to the GoF book.

My patterns:

  • Typed / Untyped pattern
  • Typed Avatar pattern (see Hydra and Node)
    • Typed Options pattern (see EulerHS)
  • Control Structure pattern (see CLI control structure in Hydra and similar in Node)