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
var handle = null; | |
handle = $.PeriodicalUpdater('/notifications', { | |
method: 'GET', | |
data: id: $field_id, | |
cookie: false, | |
maxTimeout: 5000, | |
error: function (xhr,status,message) { | |
// Do stuff | |
handle.stop(); | |
} |
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
public class Retry { | |
private static final Logger log = Logger.getLogger(Retry.class); | |
public static interface CallToRetry<T> { | |
<T> T doIt() throws Exception; | |
} | |
public static T withRetry(int maxTimes, long initialWait, int waitMultiplier, CallToRetry<T> call) { | |
if(maxTimes <= 0) { |
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
public class ExceptionEater { | |
private static final Logger log = //TODO Create Logger | |
public static <T> T swallowNPE(Supplier<T> producer) { | |
try { | |
return supplier.get(); | |
} catch(NullPointerException npe) { | |
log.info("NullPointerException being swallowed", npe); |
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
public class ExceptionEater { | |
private static final Logger log = //TODO Create Logger | |
public static <T> Optional<T> swallowNPE(Supplier<T> producer) { | |
try { | |
return Optional.ofNullable(supplier.get()); | |
} catch(NullPointerException npe) { | |
log.info("NullPointerException being swallowed", npe); | |
return Optional.empty(); |
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
@CompileStatic | |
abstract class MagnusProperty<T> { | |
final String key; | |
MagnusProperty(String key) { | |
assert key : "No key provided!" | |
this.key = key | |
} |
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
public enum TimePeriod { | |
ONE_YEAR_AGO(Calendar.YEAR, -1), | |
THREE_MONTHS_AGO(Calendar.MONTH, -3), | |
// and so on... | |
; | |
private int calendarField; | |
private int changeMagnitude; | |
private TimePeriod(int calendarField, int changeMagnitude) { |
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
<html> | |
<head> | |
<script src="check1.js"></script> | |
<script> | |
var modzrFlash; | |
Check1( | |
"hasFlash", | |
"https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.3/modernizr.min.js", | |
function() { | |
return Modernizr.flash; |
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
robert=# \d+ changeset | |
Table "public.changeset" | |
Column | Type | Modifiers | Storage | Stats target | Description | |
--------+---------+--------------------------------------------------------+---------+--------------+------------- | |
id | integer | not null default nextval('changeset_id_seq'::regclass) | plain | | | |
Indexes: | |
"changeset_pkey" PRIMARY KEY, btree (id) | |
Referenced by: | |
TABLE "state" CONSTRAINT "state_changeset_id_fkey" FOREIGN KEY (changeset_id) REFERENCES changeset(id) | |
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
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE TemplateHaskell #-} | |
{-# LANGUAGE TypeOperators #-} | |
module Lib | |
( startApp | |
, app | |
) where | |
import Data.Aeson | |
import Data.Aeson.TH |
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
module Main exposing (main) | |
import Navigation exposing (program, Location) | |
import Platform.Cmd as Cmd exposing (Cmd) | |
import Platform.Sub as Sub exposing (Sub) | |
import Html exposing (Html) | |
import Html.Attributes as Attr | |
import Html.Events as Event | |
import Routes exposing (Route(..)) | |
import RemoteData exposing (..) |