Skip to content

Instantly share code, notes, and snippets.

Ferdinand Svehla fsvehla

  • Vienna, Austria
Block or report user

Report or block fsvehla

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:4c9dac747a492a99f511c032075645fd
"optional": [
{ "name": "limit", "type": "Number", "description": "Number of results in response (in a page)." },
{ "name": "offset", "type": "Number", "description": "Number of results to skip (to get a particular page)." },
{ "name": "entity_type", "type": "String", "enumeration": [
"company",
"branch"
]},
{ "name": "parent_orb_num", "type": "String" },
{ "name": "ultimate_parent_orb_num", "type": "String" },
{ "name": "industry", "type": "String", "description": "Company’s industry." },
View keybase.md

Keybase proof

I hereby claim:

  • I am fsvehla on github.
  • I am fsvehla (https://keybase.io/fsvehla) on keybase.
  • I have a public key ASCtvIXILZSrTz5gAnrBZp4hwT10Kp7KIfQ5URJgbybHaQo

To claim this, I am signing this object:

View JsonInstances.scala
package json
import java.time.format.{DateTimeFormatter, DateTimeParseException}
import java.time.{Instant, LocalDateTime, ZoneId, ZonedDateTime}
import cats.data.Xor
import io.circe.{Decoder, DecodingFailure, HCursor}
object JsonInstances {
/** f.ex. 'Europe/Vienna' */
View gist:2a3352f18d65204a057e
function jdk7 () {
export JVM_VERSION='1.7.0_51'
# Java
export JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk${JVM_VERSION}.jdk/Contents/Home"
export PATH="${JAVA_HOME}/bin:${PATH}"
}
function jdk8 () {
export JVM_VERSION='1.8.0_20'
View gist:6387428
def transformKeys[A,B,C](m: Map[A, B], transformFunc: (A => C)): Map[C, B] = {
m.foldLeft(Map.empty[C, B]) { (acc, entry) =>
acc + (transformFunc(entry._1) -> entry._2)
}
}
val numMap: Map[Int, String] = Map(1 -> "Two", 2 -> "Four", 3 -> "Six")
val transformed = transformKeys(numMap, { (key:Int) => key * 2 })
// without (key:Int) = error: missing parameter type
View jsdiff.bash
#!/bin/bash
set -e
difftool=diff
[[ -f /usr/local/bin/ksdiff ]] && difftool=ksdiff
lname=$(echo $1 | tr '/' '-')
rname=$(echo $2 | tr '/' '-')
View gist:4149387
Shut down the computer.
- Plug in the MagSafe power adapter to a power source, connecting it to the Mac if its not already connected.
- On the built-in keyboard, press the (left side) Shift-Control-Option keys and the power button at the same time.
- Release all the keys and the power button at the same time.
- Press the power button to turn on the computer.
Note: The LED on the MagSafe power adapter may change states or temporarily turn off when you reset the SMC.
View multi-listen.js
var http = require('http');
var server = http.createServer(function (req, res) {
res.end('hullo');
});
server.listen(1250, function () {
console.log('Listening on 1250');
});
View gist:3714641
daemon off;
pid /tmp/nginx-80-to-8888.pid;
events {
worker_connections 102480;
multi_accept on;
}
http {
server {
View gist:2595281
(defn run-process
"Runs the process"
[args]
(->>
(new ProcessBuilder args)
(.start)
))
(defn exec
"Returns the ouput of the command, which is assumed to smallish and non-binary."
You can’t perform that action at this time.