Skip to content

Instantly share code, notes, and snippets.

@jproyo
jproyo / ghci.conf
Last active January 20, 2019 12:07
Local Ghci configuration
:set prompt "λx.x> "
:set prompt-cont " > "
:set -XNoStarIsType
:set -XGADTSyntax
:set -XGeneralizedNewtypeDeriving
:set -XInstanceSigs
:set -XLambdaCase
:set -XPartialTypeSignatures
:set -XScopedTypeVariables
:set -XTypeApplications
@jproyo
jproyo / cats_syntax.scala
Created December 6, 2018 15:31
Add syntactic sugar to Cats Scala Type Classes combinators - Syntax
import cats.syntax.apply._
IO.shift *> task
// equivalent to
implicitly[ContextShift[IO]].shift *> task
@jproyo
jproyo / gist:28faf139bad26517f45755db21b59f6b
Created July 5, 2016 15:42 — forked from eduardocardoso/gist:82a629882ddb02ab3677
Script to delete exited containers and untagged/unused images from docker
#!/bin/bash
set -o errexit
echo "Removing exited docker containers..."
docker ps -a -f status=exited -q | xargs -r docker rm -v
echo "Removing dangling images..."
docker images --no-trunc -q -f dangling=true | xargs -r docker rmi
@jproyo
jproyo / prepare-commit-msg
Created May 28, 2013 19:59
Prepare Commit Message with Prepend Branch named for Git
#!/bin/sh
NAME=$(git branch | grep '*' | sed 's/* //')
echo "[#$NAME"': '$(cat "$1")"]" > "$1"
@jproyo
jproyo / git_move.sh
Created November 16, 2012 14:45
moves a folder from one git repo into another repo with history intact
#!/usr/bash
# Usage:
# ./git_move.sh git@repo_site.com:/my_repo.git origin/folder/path/ /destination/repo/path/ new/folder/path/
repo=$1
folder=$2
dest_repo=$3
dest_folder=$4
clone_folder='__git_clone_repo__'
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)%Creset' --abbrev-commit"
git lg -g (To see file changes)
@jproyo
jproyo / get-branch
Created May 7, 2012 20:47
Git SVN Get and Configure Remote Branch/Tag
#!/bin/bash
usage()
{
echo "This script get a specific branch/tag from SVN through git-svn and config in your .git/config ref."
echo "OPTIONS:"
echo " -h Show help"
echo " -t Tag Name that we want to label our branch localy"
echo " -u SVN Tag URL"
}
@jproyo
jproyo / git_bash
Created May 7, 2012 20:43
Git Bash prompt improvement
#!/bin/bash
#function parse_git_branch {
# ref=$(git-symbolic-ref HEAD 2> /dev/null) || return
# echo "("${ref#refs/heads/}")"
#}
function parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
@jproyo
jproyo / mvn-release-batch-mode
Created May 7, 2012 14:51
Maven Release Silent Mode
mvn -B release:prepare -DdryRun=true -Dchas-support-api-version=22.0.0 -Dchas-support-version=22.0.0 -Dtag=chas-flight-23.0.0 -DreleaseVersion=23.0.0 -DdevelopmentVersion=23.0.1-SNAPSHOT