Skip to content

Instantly share code, notes, and snippets.

View marcellodesales's full-sized avatar

Marcello DeSales marcellodesales

View GitHub Profile
@hasufell
hasufell / Playground.hs
Last active November 28, 2021 04:56
Plutus Playground Smart Contract
import Control.Monad (void)
import Data.Aeson (FromJSON, ToJSON)
import qualified Data.Text as T
import GHC.Generics (Generic)
import Language.Plutus.Contract
import qualified Language.PlutusTx as PlutusTx
import Language.PlutusTx.Prelude
import Ledger
import qualified Ledger.Ada as Ada
import qualified Ledger.Constraints as Constraints
@ArgonQQ
ArgonQQ / README.md
Last active March 3, 2023 02:06
Brew install specific version / Locally freeze version

Brew install specific version / Locally freeze version

# Please define variables
packageName=<packageName>
packageVersion=<packageVersion>

# Create a new tab
brew tap-new local/$packageName
@and-pete
and-pete / Dockerfile
Created August 30, 2020 13:08
Multi-Stage Docker Build for a Haskell (Stack) Project
# The below is a combination of the following two things:
# 1) This article + corresponding Gist: https://medium.com/permutive/optimized-docker-builds-for-haskell-76a9808eb10b
# 2) This Reddit comment in response to the above:
# - https://www.reddit.com/r/haskell/comments/cl5uod/optimized_docker_builds_for_haskell/evuzccm/
# It is a multi-stage Docker build with 3 stages: 1) dependencies, 2) build, and 3) deploy
# -------------------------------------------------------------------------------------------
# STAGE 1: Dependencies
# -------------------------------------------------------------------------------------------
FROM haskell:8.10.2 as dependencies
@calexandre
calexandre / merge-zsh-history.sh
Last active April 3, 2024 14:11
Merge two zsh history files
#!/bin/bash
# Inspired on https://david-kerwick.github.io/2017-01-04-combining-zsh-history-files/
set -e
history1=$1
history2=$2
merged=$3
echo "Merging history files: $history1 + $history2"
test ! -f $history1 && echo "File $history1 not found" && exit 1
@DimaKoz
DimaKoz / go-executable-build.sh
Last active January 29, 2024 07:02
The Script to Automate Cross-Compilation for Golang(OSX)
#Before we can use the script, we have to make it executable with the chmod command:
#chmod +x ./go-executable-build.sh
#then we can use it ./go-executable-build.sh yourpackage
#!/usr/bin/env bash
package=$1
if [[ -z "$package" ]]; then
echo "usage: $0 <package-name>"
exit 1
fi
@tokland
tokland / puppeteer-click-by-text.js
Last active August 11, 2023 03:48
Click link by text in Puppeteer
const puppeteer = require('puppeteer');
const escapeXpathString = str => {
const splitedQuotes = str.replace(/'/g, `', "'", '`);
return `concat('${splitedQuotes}', '')`;
};
const clickByText = async (page, text) => {
const escapedText = escapeXpathString(text);
const linkHandlers = await page.$x(`//a[contains(text(), ${escapedText})]`);
@yancyn
yancyn / git-svn.md
Last active February 9, 2024 17:44
Migrate Archive Google Code SVN to Git

Migrate Archive Google Code SVN to Git

Requirements

  • git
  • git-svn

Setup¹

$ sudo apt-get install git
$ sudo add-apt-repository ppa:git-core/ppa
@cschiewek
cschiewek / x11_docker_mac.md
Last active April 5, 2024 22:38
X11 in docker on macOS

To forward X11 from inside a docker container to a host running macOS

  1. Install XQuartz: https://www.xquartz.org/
  2. Launch XQuartz. Under the XQuartz menu, select Preferences
  3. Go to the security tab and ensure "Allow connections from network clients" is checked.
  4. Run xhost + ${hostname} to allow connections to the macOS host *
  5. Setup a HOSTNAME env var export HOSTNAME=`hostname`*
  6. Add the following to your docker-compose:
 environment:
@proffalken
proffalken / Dockerfile
Created January 25, 2017 14:56
Jenkins Blue Ocean Python Development
FROM jenkinsci/blueocean:latest
USER root
RUN apk add --no-cache --update \
python \
python-dev \
py-pip \
build-base \
&& pip install virtualenv \
@androidfred
androidfred / haskell_stack_and_intellij_idea_ide_setup_tutorial_how_to_get_started.md
Last active February 4, 2024 20:58
Haskell, Stack and Intellij IDEA IDE setup tutorial how to get started

Haskell, Stack and Intellij IDEA IDE setup tutorial how to get started

Upon completion you will have a sane, productive Haskell environment adhering to best practices.

Basics

  • Haskell is a programming language.
  • Stack is tool for Haskell projects. (similar tools for other languages include Maven, Gradle, npm, RubyGems etc)
  • Intellij IDEA IDE is a popular IDE.

Install required libraries

sudo apt-get install libtinfo-dev libghc-zlib-dev libghc-zlib-bindings-dev