Skip to content

Instantly share code, notes, and snippets.

View paradoja's full-sized avatar

Abby Henríquez Tejera paradoja

View GitHub Profile
@paradoja
paradoja / gc_tips.md
Created October 18, 2020 09:37 — forked from kishiamy/gc_tips.md
Tips for Gran Canaria

To eat

import shapeless._, syntax.std.product._, spray.json.{JsNumber, JsString}
case class Person(name: String, age: Int)
val p = Person("Pepe", 54)
p.toMap[Symbol, Any] // res0: Map[Symbol,Any] = Map('age -> 54, 'name -> Pepe)
p.toMap[Symbol, Any].map {
case (s, i: Int) => s.toString -> JsNumber(i)
import Resolvers._
object add {
def apply(org: String, sub: String) = {
val newResolver = Resolver.Http("bintray", s"https://dl.bintray.com/$org/$sub/", MavenPattern, true)
interp.resolvers() = interp.resolvers() :+ newResolver
}
}
{-# OPTIONS_GHC -XDeriveDataTypeable #-}
import XMonad
import Data.Monoid
import System.Exit
import XMonad.Config.Gnome
import qualified XMonad.StackSet as W
import qualified Data.Map as M
import XMonad.Util.Run (safeSpawn)
@paradoja
paradoja / open-ec
Created July 7, 2015 08:18
It's All Text! emacsclient launcher
!#/bin/bash
/usr/local/bin/emacsclient -c "$@"
@paradoja
paradoja / App.java
Created March 16, 2015 18:38
Test Java Neo4j JDBC Rest connection
package gdbTest;
import org.neo4j.jdbc.Driver;
import org.neo4j.jdbc.Neo4jConnection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Properties;
for i in `ls -rt DIRECTORY`; do; if [ -f DIRECTORY/$i ]; then grep -H PATTERN DIRECTORY/$i; fi; done
for i in `find .`; do echo $i `grep -c PATTERN $i` | awk '{ if ($2 > 1) print $1}' ; done
# $Id: screen-keys.conf,v 1.7 2010-07-31 11:39:13 nicm Exp $
#
# By Nicholas Marriott. Public domain.
#
# This configuration file binds many of the common GNU screen key bindings to
# appropriate tmux key bindings. Note that for some key bindings there is no
# tmux analogue and also that this set omits binding some commands available in
# tmux but not in screen.
#
# Note this is only a selection of key bindings and they are in addition to the
@paradoja
paradoja / ghci.hs
Created November 5, 2012 03:15
Compressed powerset
import Control.Monad
import Data.List
let unRoll = join .map (uncurry $ flip replicate)
let roll = map $ map (\l@(x:_) -> (x, length l)) . group:: [String] -> [[(Char, Int)]]
let powerSet = roll . nub . filterM (const [True, False]) . unRoll
powerSet [('a',2), ('b',2)]