Skip to content

Instantly share code, notes, and snippets.

View manuelkiessling's full-sized avatar

Manuel Kießling manuelkiessling

View GitHub Profile
@adriennetacke
adriennetacke / countdown.js
Last active September 1, 2022 04:18
Countdown timer in pure JavaScript
function countdown(endDate) {
let days, hours, minutes, seconds;
endDate = new Date(endDate).getTime();
if (isNaN(endDate)) {
return;
}
setInterval(calculate, 1000);
@atamborrino
atamborrino / cassStream.scala
Last active March 2, 2020 12:02
Cassandra Akka Stream on top of Java client with no other deps
import akka.stream.scaladsl.Source
import com.datastax.driver.core.{Row, Session, Statement}
import com.google.common.util.concurrent.{Futures, FutureCallback, ListenableFuture}
import scala.concurrent.{Promise, Future, ExecutionContext}
object StreamCassandraHelper {
import scala.collection.JavaConversions._
def executeAsStream(stmt: Statement)(implicit ec: ExecutionContext, session: Session): Source[Row, Unit] = {
@carlos8f
carlos8f / gist:3473107
Last active September 5, 2020 15:44
siege Mac OS X caveats
Mac OS X has only 16K ports available that won't be released until socket
TIME_WAIT is passed. The default timeout for TIME_WAIT is 15 seconds.
Consider reducing in case of available port bottleneck.
You can check whether this is a problem with netstat:
# sysctl net.inet.tcp.msl
net.inet.tcp.msl: 15000
# sudo sysctl -w net.inet.tcp.msl=100
require 'spec_helper'
describe SharesController do
render_views
describe '#create' do
let(:share_params) { :facebook_id => 'abc', :address_id => 7 }
it "redirects to login" do
post :create, :share => share_params
<?php
abstract class cCommandLineTool implements cCommandLineToolInterface extends cTool {
const TYPE_DECLARED = 0;
const TYPE_BOOLEAN = 1;
private $sCronjobTitle = NULL;
private $sCronjobDescription = NULL;
private $aArguments = array();