Skip to content

Instantly share code, notes, and snippets.

@jboner
jboner / OrderManagement.scala
Created Nov 10, 2017
Demo of an Event-driven Architecture in Akka and Scala. Show-casing Events-first DDD, Event Sourced Aggregates, Process Manager, etc.
View OrderManagement.scala
package sample.eventdriven.scala
import akka.actor.{Actor, ActorRef, ActorSystem, Inbox, Props}
import akka.persistence.PersistentActor
import scala.concurrent.ExecutionContext.Implicits._
import scala.concurrent.duration._
// ===============================================================
// Demo of an Event-driven Architecture in Akka and Scala.
@bastman
bastman / docker-cleanup-resources.md
Created Mar 31, 2016
docker cleanup guide: containers, images, volumes, networks
View docker-cleanup-resources.md

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@hassy
hassy / parse_aws.md
Last active Jun 6, 2021
Deploying Parse Server on AWS (WIP)
View parse_aws.md

Deploying Parse Server on AWS

Note: this is a work-in-progress and will be updated with more information over the next few days.

Intro

This guide will walk you through deploying your own instance of the open-source Parse Server. This would be a good starting point for testing your existing application to see if the functionality provided by the server is enough for your application, and to potentially plan your migration off the Parse Platform.

This guide will walk you through using Elastic Beanstalk (EB), which is an AWS service similar to Heroku. Why use EB rather than Heroku? Elastic Beanstalk does not lock you into Heroku-specific ways of doing things, is likely cheaper to run your backend on than Heroku, and it integrates with other services that AWS offer (and they offer almost everything one needs to run an application these days).

View scala-cheatsheet.md

This cheat sheet originated from the forum, credits to Laurent Poulain. We copied it and changed or added a few things.

Evaluation Rules

  • Call by value: evaluates the function arguments before calling the function
  • Call by name: evaluates the function first, and then evaluates the arguments if need be
    def example = 2      // evaluated when called
    val example = 2      // evaluated immediately
@Vestride
Vestride / encoding-video.md
Last active Aug 9, 2022
Encoding video for the web
View encoding-video.md

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
@yoavniran
yoavniran / ultimate-ut-cheat-sheet.md
Last active Aug 6, 2022
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai, Sinon, and Jest
View ultimate-ut-cheat-sheet.md
View gist:9919357

Pry Cheat Sheet

Command Line

  • pry -r ./config/app_init_file.rb - load your app into a pry session (look at the file loaded by config.ru)
  • pry -r ./config/environment.rb - load your rails into a pry session

Debugger

@askmike
askmike / candleCalculator.js
Created Jun 21, 2013
Calculate trade candles for the MtGox exchange from a [sqlite trade database](https://bitcointalk.org/index.php?topic=221055.0).
View candleCalculator.js
var mtgoxDump = './dump.sql'; // this is the database file outputted by the Trade Downloader ( https://bitcointalk.org/index.php?topic=221055.0 )
var output = './candles-' + (+new Date()) + '.csv'; // csv file with your candles
var db = require('sqlite-wrapper')(mtgoxDump);
var moment = require('moment');
var _ = require('underscore');
var fs = require('fs');
var i = 0;