Skip to content

Instantly share code, notes, and snippets.

@jmacias
jmacias / .emacs
Created January 6, 2017 22:10 — forked from kaz-yos/.emacs
.emacs file to run Spacemacs and regular Emacs side by side.
;;; dot_emacs.el --- -*- lexical-binding: t; -*-
;;; Select emacs config file directory depending on emacs being run
;; Added by Package.el. This must come before configurations of
;; installed packages. Don't delete this line. If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments.
;; (package-initialize)
@jmacias
jmacias / Main.scala
Created August 22, 2016 20:31 — forked from jpallari/Main.scala
Ways to pattern match generic types in Scala
object Main extends App {
AvoidLosingGenericType.run()
AvoidMatchingOnGenericTypeParams.run()
TypeableExample.run()
TypeTagExample.run()
}
class Funky[A, B](val foo: A, val bar: B) {
override def toString: String = s"Funky($foo, $bar)"
}
@jmacias
jmacias / gist:465846849471464d4cde
Created February 29, 2016 21:19
AZURE STORAGE SHARE FILES SECURE URIS
https://github.com/jlark/azurelinuxbackup/blob/master/backupAzure
http://www.cnblogs.com/hengwei/p/5189385.html
azure storage blob upload -a $storageAccountName --container $storageContainer -k $storageAccountKey $backupfile
azure storage file upload -a $storageAccountName --container $storageContainer -k $storageAccountKey $backupfile
@jmacias
jmacias / go_docker.md
Created February 2, 2016 00:31 — forked from scottsbaldwin/go_docker.md
Go CD in Docker

Go CD in Docker

Pull the images

docker pull gocd/gocd-server
docker pull gocd/gocd-agent

Create Data Volume Containers

@jmacias
jmacias / sbt-quickstart.txt
Created January 29, 2016 18:04 — forked from retronym/sbt-quickstart.txt
try a library with sbt-extras
~/code/scratch1 sbt -sbt-create -scala-version 2.10.0 'set libraryDependencies += "org.scalaz" %% "scalaz-core" % "7.0.0-M7"' 'console'
Detected sbt version 0.12.2-RC2
Using /Users/jason/.sbt/0.12.2-RC2 as sbt dir, -sbt-dir to override.
[info] Set current project to default-821d14 (in build file:/Users/jason/code/scratch1/)
[info] Defining */*:log-level
[info] The new value will be used by no settings or tasks.
[info] Reapplying settings...
[info] Set current project to default-821d14 (in build file:/Users/jason/code/scratch1/)
[info] Defining {.}/*:scala-version
[info] The new value will be used by no settings or tasks.
@jmacias
jmacias / README.md
Created January 17, 2016 03:20 — forked from ThatRendle/README.md
Vagrantfile to run Kafka in boot2docker

Kafka in Docker in Vagrant

I'm using this Vagrantfile to run Kafka on a Windows 8.1 laptop for development purposes.

It runs the ultra-lightweight boot2docker Linux, then uses Vagrant's Docker provisioning support to spin up ZooKeeper and Kafka.

The fun bits to work out were:

  • You need to forward the ports on both Vagrant (lines 13 & 14) and Docker (the -p flag), so you can access the instance from Windows using localhost:9092
@jmacias
jmacias / AzureStorageDeployTask.groovy
Created January 13, 2016 17:20 — forked from clemp6r/AzureStorageDeployTask.groovy
Gradle task for deploying a file to Azure Blob Storage
package com.github.clemp6r.azuregradle
import org.gradle.api.DefaultTask
import com.microsoft.azure.storage.*;
import com.microsoft.azure.storage.blob.*
import org.gradle.api.tasks.TaskAction;
class AzureStorageDeployTask extends DefaultTask {
@jmacias
jmacias / gist:17e9b6f516b16acaf6ed
Created December 4, 2015 00:54 — forked from SeanTAllen/gist:6b47d41113ab3acdab6d
Online whiteboard solutions
I asked on twitter for online whiteboard solutions. These are some of the
ones that were suggested. There's a few that I managed to check out
quickly and got rid of the links without thinking that I might want
them for posterity. This is what I had left. Know of others? Please
add in comments.
http://smartkapp.com/en/products/kapp?gclid=CKWCvvi8hMgCFQuLaQodAU0KnQ
https://awwapp.com
https://realtimeboard.com
http://webwhiteboard.com/#/
@jmacias
jmacias / Console.scala
Created November 24, 2015 11:03 — forked from msiegenthaler/Console.scala
Example for a free monad based console IO. Based upon http://underscore.io/blog/posts/2015/04/14/free-monads-are-simple.html.
import scalaz._
import scalaz.syntax.monad._
object Console {
import ConsoleOp._
def println(text: String): Console[Unit] = Free.liftFC(Println(text))
def readln: Console[String] = Free.liftFC(Readln())
//cannot use FreeC, because type inference for implicits will diverge