Skip to content

Instantly share code, notes, and snippets.

View Per48edjes's full-sized avatar
👉
This is a good point.

Ravi Dayabhai Per48edjes

👉
This is a good point.
View GitHub Profile
@YakBarber
YakBarber / Main.hs
Last active April 12, 2024 20:23
Tic Tac Toe in Haskell - Barry Van Tassell
module Main (main) where
-- build-depends: base, containers, mtl
import qualified Data.List as L
import Data.Maybe (fromJust)
import Data.Char (digitToInt, toLower)
import qualified Control.Monad.State.Lazy as S
----------------------
@dino-
dino- / string-conversions.hs
Last active May 3, 2024 08:57
A handy illustration of converting between String, Text and ByteString in Haskell
#! /usr/bin/env stack
-- stack --resolver lts-18.8 script
{-# LANGUAGE OverloadedStrings #-}
{-
This is a handy illustration of converting between five of the commonly-used
string types in Haskell (String, ByteString, lazy ByteString, Text and lazy
Text).
@mikehwang
mikehwang / jq-profilejsonschema.md
Last active April 7, 2024 17:55
Use jq to profile the schema of a given JSON object or an array of JSONs objects

Profile JSON schema

Using jq is great for examining JSON objects. You can extend its functionality with custom methods. The following is useful to understand at a high level the structure of arbitrary JSONs which is useful when trying to understand new data sources.

Requires jq verison 1.5.

Profile an object

Add the following method to your ~/.jq:

@subfuzion
subfuzion / global-gitignore.md
Last active May 5, 2024 19:34
Global gitignore

There are certain files created by particular editors, IDEs, operating systems, etc., that do not belong in a repository. But adding system-specific files to the repo's .gitignore is considered a poor practice. This file should only exclude files and directories that are a part of the package that should not be versioned (such as the node_modules directory) as well as files that are generated (and regenerated) as artifacts of a build process.

All other files should be in your own global gitignore file:

  • Create a file called .gitignore in your home directory and add any filepath patterns you want to ignore.
  • Tell git where your global gitignore file is.

Note: The specific name and path you choose aren't important as long as you configure git to find it, as shown below. You could substitute .config/git/ignore for .gitignore in your home directory, if you prefer.