Skip to content

Instantly share code, notes, and snippets.

@lloydmeta
lloydmeta / AkkaStreamSparkIntegration.scala
Last active January 28, 2021 17:11
Example for how to connect Akka Stream and Spark Streaming by turning creating a Flow element that feeds into an InputDstream
import akka.actor._
import akka.stream.scaladsl.Flow
import org.apache.spark.streaming.dstream.ReceiverInputDStream
import org.apache.spark.streaming.receiver.ActorHelper
import akka.actor.{ ExtensionKey, Extension, ExtendedActorSystem }
import scala.reflect.ClassTag
object AkkaStreamSparkIntegration {

This is unmaintained, please visit Ben-PH/spacemacs-cheatsheet

Useful Spacemacs commands

  • SPC q q - quit
  • SPC w / - split window vertically
  • SPC w - - split window horizontally
  • SPC 1 - switch to window 1
  • SPC 2 - switch to window 2
  • SPC w c - delete current window
@lihaoyi
lihaoyi / trace.scala
Last active December 27, 2015 19:32
Downloading JSON and splatting it into some files in 4 lines of Scala with Ammonite http://lihaoyi.github.io/Ammonite/
haoyi-mbp:Ammonite haoyi$ ~/amm
Loading...
Welcome to the Ammonite Repl 0.5.2
(Scala 2.11.7 Java 1.8.0_25)
haoyi-Ammonite@ load.ivy("org.scalaj" %% "scalaj-http" % "2.2.0")
haoyi-Ammonite@ import ammonite.ops._, scalaj.http._
import ammonite.ops._, scalaj.http._
haoyi-Ammonite@ Http("https://api.github.com/repos/scala/scala").asString
res2: HttpResponse[String] = HttpResponse(
@Chandler
Chandler / slack_history.py
Last active March 27, 2025 01:16
Download Slack Channel/PrivateChannel/DirectMessage History
print("UPDATE AUG 2023: this script is beyond old and broken")
print("You may find interesting and more up to date resources in the comments of the gist")
exit()
from slacker import Slacker
import json
import argparse
import os
# This script finds all channels, private channels and direct messages
#!/usr/bin/python3
# pip3 install markdown
template = """<!DOCTYPE html>
<html dir="rtl">
<head>
<meta charset="utf-8">
</head>
<body>
lazy val dotEnvFile = taskKey[String]("Defines the file to load environment variables from")
dotEnvFile := ".env"
// The task returns the loaded dotEnv file and a map of the loaded variables, in case it would need to be manipulated somewhere else
lazy val loadEnv = taskKey[(File, Map[String, String])]("""Loads the environment variables from file defined by task `dotEnvFile` (they must follow the format "export X=Y")""")
loadEnv := {
val logger = ConsoleLogger()
val sourceFileName = dotEnvFile.value
@gigiigig
gigiigig / auxpattern.scala
Last active January 8, 2025 00:31
Aux Pattern
import shapeless._
import scalaz._
import Scalaz._
object console extends App {
trait Foo[A] {
type B
def value: B
@fernandezpablo85
fernandezpablo85 / git-maven-howto.md
Last active September 22, 2024 11:36
how to create your own maven repository on github

How to create a maven repository for your github project step by step

Clone your project in a separate folder

(note: replace ORGANIZATION and PROJECT)

git clone git clone [email protected]:ORGANIZATION/PROJECT.git my-repository

Cd into it

@DanielaSfregola
DanielaSfregola / customEventBusExample.scala
Last active October 12, 2019 07:46
An example on how to customize an Event Bus in Akka. See article http://danielasfregola.com/2015/04/20/peer-to-many-communication-in-akka/
import akka.actor._
import akka.event.{LookupClassification, EventBus}
import akka.event.ActorEventBus
case class Book(title: String, authors: List[String])
class AuthorBookBus(author: String) extends EventBus
with LookupClassification
with ActorEventBus {
@fzerorubigd
fzerorubigd / blocked
Last active August 29, 2015 14:16
block list for cow, in iran. please add anything you need
code.google.com
googleapis.com
googleusercontent.com
ytimg.com
youtube.com
youtube-nocookie.com
bitbucket.org
thepiratebay.se
humblebundle.com
plus.url.google.com