Skip to content

Instantly share code, notes, and snippets.

View gabesoft's full-sized avatar

Gabriel Adomnicai gabesoft

  • Quip
  • San Francisco
View GitHub Profile
@dorchard
dorchard / gist:7ed17c66677a64d069ff
Last active August 30, 2016 05:53
My QuickCheck instance for Data.Matrix (square matrices)
instance (Arbitrary a) => Arbitrary (Matrix a) where
-- NB: for square matrices
arbitrary = sized (\n -> do xs <- vectorOf (n*n) arbitrary
return $ matrix n n (\(i, j) -> xs !! ((i-1)*n + (j-1))))
@jdoles
jdoles / logging.yml
Last active February 5, 2017 00:49
elasticsearch logging.yml with syslog
# you can override this using by setting a system property, for example -Des.logger.level=DEBUG
es.logger.level: DEBUG
rootLogger: ${es.logger.level}, console, file, syslog
logger:
# log action execution errors for easier debugging
action: DEBUG
# reduce the logging for aws, too much is logged under the default INFO
com.amazonaws: WARN
# gateway
@Scorpil
Scorpil / emacs_ensime_scala.md
Created October 2, 2012 16:59
Using Emacs with Ensime for Scala development

This tutorial is tested on Debian linux. Should work on other platforms with minimal changes. This post really helped: http://jawher.net/2011/01/17/scala-development-environment-emacs-sbt-ensime/

  • Install jdk and sbt (more on that: https://class.coursera.org/progfun-2012-001/wiki/view?page=ToolsSetup)
  • Install scala-mode for Emacs:
    apt-get install subversion  # in case you don't have subversion already installed 
    svn export http://lampsvn.epfl.ch/svn-repos/scala/scala-tool-support/trunk/src/emacs scala-emacs
    mkdir ~/.emacs.d/scala  # creating folder for scala extensions

mv scala-emacs ~/.emacs.d/scala # moving scala-mode to new folder

@legumbre
legumbre / foo.md
Created June 29, 2012 00:14
resolving merge conflicts with magit-ediff

Use magit-ediff to resolve merge conflicts

Use magit-ediff or 'e' on an unmerged item to resolve merge conflicts with ediff. Magit will set up an ediff with three buffers A, B and C. A and B are the original (conflicting) files, and C is the conflicted merge.

Use 'n'/'p' to move to the next/previous conflict, use 'a'/'b' to choose which changes (those in a A or B) should be the ones to keep in the merged file.

You can always just switch to buffer C and edit what the merged version should look like.

@davidallsopp
davidallsopp / PropertyTests.scala
Last active September 16, 2020 14:07
Examples of writing mixed unit/property-based (ScalaTest with ScalaCheck) tests. Includes tables and generators as well as 'traditional' tests.
/**
* Examples of writing mixed unit/property-based (ScalaCheck) tests.
*
* Includes tables and generators as well as 'traditional' tests.
*
* @see http://www.scalatest.org/user_guide/selecting_a_style
* @see http://www.scalatest.org/user_guide/property_based_testing
*/
import org.scalatest._
@yoshuawuyts
yoshuawuyts / Q&A.md
Created March 16, 2016 05:58 — forked from novaluke/0-Q&A.md
I want to use Nix for development, but... -- answers to common concerns about Nix

Nix seems perfect for developers - until I try to use it...

Want to use Nix for development but you're not sure how? Concerned about the fluidity of nixpkgs channels or not being able to easily install arbitrary package versions?

When I first heard about Nix it seemed like the perfect tool for a developer. When I tried to actually use it for developing and deploying web apps, though, the pieces just didn't seem to add up.

@runarorama
runarorama / gist:a8fab38e473fafa0921d
Last active April 13, 2021 22:28
Compositional application architecture with reasonably priced monads
sealed trait Interact[A]
case class Ask(prompt: String)
extends Interact[String]
case class Tell(msg: String)
extends Interact[Unit]
trait Monad[M[_]] {
def pure[A](a: A): M[A]
@dmkash
dmkash / br.sh
Created April 10, 2012 22:44
Shell Script for tmux setup
#!/bin/sh
SESSION_NAME="big_red"
cd ~/Sites/within3/big_red
tmux has-session -t ${SESSION_NAME}
if [ $? != 0 ]
then
@novaluke
novaluke / 0-Q&A.md
Last active April 29, 2023 17:23
I want to use Nix for development, but... -- answers to common concerns about Nix

Nix seems perfect for developers - until I try to use it...

Want to use Nix for development but you're not sure how? Concerned about the fluidity of nixpkgs channels or not being able to easily install arbitrary package versions?

When I first heard about Nix it seemed like the perfect tool for a developer. When I tried to actually use it for developing and deploying web apps, though, the pieces just didn't seem to add up.

@i-e-b
i-e-b / Readme_NIX_OS.md
Last active July 4, 2023 16:53
/etc/nixos/configuration.nix

My experiments with an XMonad setup in NixOS. This is my work box now, so it pretty much works.

probably needs:

# useradd -m iain
# passwd iain ...
# passwd root ...