This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function countdown(endDate) { | |
let days, hours, minutes, seconds; | |
endDate = new Date(endDate).getTime(); | |
if (isNaN(endDate)) { | |
return; | |
} | |
setInterval(calculate, 1000); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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(); |