Skip to content

Instantly share code, notes, and snippets.

View oluies's full-sized avatar

Örjan Angré (Lundberg) oluies

  • Sweden
  • 22:43 (UTC +02:00)
  • X @oluies
View GitHub Profile
@andypiper
andypiper / basic-recipes.md
Last active September 5, 2022 14:53
Twitter API recipes for twurl +jq, and other useful Twitter code snippets and tools
@deanwampler
deanwampler / GraphFramesExample.snb
Created March 4, 2016 13:03
Databrick's Python example for the new GraphFrame API ported to Scala and Spark Notebook
{
"metadata" : {
"name" : "GraphFramesExample",
"user_save_timestamp" : "1970-01-01T01:00:00.000Z",
"auto_save_timestamp" : "1970-01-01T01:00:00.000Z",
"language_info" : {
"name" : "scala",
"file_extension" : "scala",
"codemirror_mode" : "text/x-scala"
},
@rjsvaljean
rjsvaljean / TypedPipelineComposition.scala
Last active February 8, 2016 19:44
Implicit context passing between stages of a pipeline with shapeless
package com.xdotai
import shapeless._
import shapeless.ops.hlist.{Prepend, Align, Remove}
object TypedPipelineComposition {
import ShapelessExt._
@cvogt
cvogt / breakout.scala
Last active January 19, 2017 11:20
Scala collections breakOut
// a List isn't a Map
scala> val x: Map[Int,Int] = List(1,2,3).map(i => i -> i)
<console>:16: error: type mismatch;
found : List[(Int, Int)]
required: Map[Int,Int]
val x: Map[Int,Int] = List(1,2,3).map(i => i -> i)
^
// first create List, then create Map. Intermediate collection overhead
scala> val x: Map[Int,Int] = List(1,2,3).map(i => i -> i).toMap
x: Map[Int,Int] = Map(1 -> 1, 2 -> 2, 3 -> 3)
@andershammar
andershammar / install-apache-zeppelin-on-amazon-emr.sh
Last active October 9, 2018 03:31
Bootstrap script for installing Apache Zeppelin on an Amazon EMR Cluster. Verfied on Amazon EMR release 4.x.
#!/bin/bash -ex
if [ "$(cat /mnt/var/lib/info/instance.json | jq -r .isMaster)" == "true" ]; then
# Install Git
sudo yum -y install git
# Install Maven
wget -P /tmp http://apache.mirrors.spacedump.net/maven/maven-3/3.3.3/binaries/apache-maven-3.3.3-bin.tar.gz
sudo mkdir /opt/apache-maven
sudo tar -xvzf /tmp/apache-maven-3.3.3-bin.tar.gz -C /opt/apache-maven
@klenwell
klenwell / websphere.yml
Last active July 4, 2019 18:20
Ansible Playbook to Install WebSphere MQ on Debian Server
#
# This playbook assumes the WebSphere MQ file provided by IBM has already been
# downloaded to a specific directory (target.wd) on the server.
#
# ${target.wd} is a variable representing the working directory on the target
# server the MQ client will be installed.
#
# Note: Although this playbook is designed to be able to be run independently,
# it is in fact part of a longer playbook and therefore may have some other
# unexpected dependencies not reflected here.
package inception.commands;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import javax.ws.rs.client.Entity;
import org.mockito.ArgumentMatcher;
public class UnfuckEntity extends ArgumentMatcher<Entity<?>> {
@m4rw3r
m4rw3r / header.rs
Last active January 13, 2016 06:19
http.rs: Simple HTTP-library for Rust
use std::fmt;
use std::ascii::StrAsciiExt;
#[deriving(Clone,Eq)]
pub enum HeaderName {
Accept,
AcceptCharset,
AcceptEncoding,
AcceptLanguage,
Age,
@viktorklang
viktorklang / Future-retry.scala
Last active July 23, 2023 23:48
Asynchronous retry for Future in Scala
import scala.concurrent.duration._
import scala.concurrent.ExecutionContext
import scala.concurrent.Future
import akka.pattern.after
import akka.actor.Scheduler
/**
* Given an operation that produces a T, returns a Future containing the result of T, unless an exception is thrown,
* in which case the operation will be retried after _delay_ time, if there are more possible retries, which is configured through
* the _retries_ parameter. If the operation does not succeed and there is no retries left, the resulting Future will contain the last failure.
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active May 13, 2025 09:47
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results