Skip to content

Instantly share code, notes, and snippets.

# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="robbyrussell"
# Example aliases
@mrfyda
mrfyda / LoveLetter.scala
Created November 19, 2013 23:07
A SecureString Example
package model
import model.traits.BaseTable
import model.traits.SecureTable
import play.api.libs.Crypto
import scala.slick.driver.PostgresDriver.simple._
case class LoveLetter(id: Long, fromId: Long, toId: Long, content: SecureString)
(function(window, document, $) {
var FANCYBOX_OVERLAY = ".fancybox-overlay";
$(document).ready(function () {
var paceLoading = {
hideLoading: function() {
Pace.stop();
$(FANCYBOX_OVERLAY).show();
},
@mrfyda
mrfyda / karma.conf
Created March 30, 2015 19:50
mocha + karma coverage
var baseConfig = require('./karma.conf.js');
module.exports = function (config) {
// Load base config
baseConfig(config);
// Override base config
config.set({
...
@mrfyda
mrfyda / sbt-codacy-coverage-uploader-java6.sh
Last active August 30, 2019 15:29
sbt-codacy-coverage uploader for Java 6
#!/bin/sh
function coverageFilePath { echo "target/scala-$1/coverage-report/codacy-coverage.json"; }
PROJECT_TOKEN=${CODACY_PROJECT_TOKEN}
if [ -z "${PROJECT_TOKEN}" ]; then
echo "Project token not found."
exit 1
fi
@mrfyda
mrfyda / withName.scala
Last active August 29, 2015 14:21
withName hurts...
object Currency extends Enumeration {
val GBP = Value
val EUR = Value
}
Currency.withName("USD") // Boom!
Currency.values.find(_.toString == "USD") // Returns an Option. Deal with it!
@mrfyda
mrfyda / number-of-open-files.sh
Created August 4, 2015 19:13
Show open file descriptors for Java processes
for pid in `pidof java`; do echo "$(< /proc/$pid/cmdline)"; egrep 'files|Limit' /proc/$pid/limits; echo "Currently open files: $(ls -1 /proc/$pid/fd | wc -l)"; echo; done
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"patternProperties": {
"^[a-zA-Z0-9._-]+$": {
"$ref": "#/definitions/service"
}
},
"definitions": {
"service": {

Keybase proof

I hereby claim:

  • I am mrfyda on github.
  • I am mrfyda (https://keybase.io/mrfyda) on keybase.
  • I have a public key whose fingerprint is 3866 F2B0 83A0 5F8C 8BC2 A452 5C9F 51CF 6EE9 CF11

To claim this, I am signing this object: