This file contains 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
/** | |
* Given an object with a property, it tests if the property is a number and returns the round of that | |
* Otherwise returns the value provided by defaultValue, or null | |
* @param obj The object that contains the property to test | |
* @param prop The property that will be tested | |
* @param decimalsToRound The number of decimals to round to | |
* @param defaultValue The default value provided if it cannot complete the transaction | |
*/ | |
export const roundOrDefault = (obj: any, prop: string, decimalsToRound: number, defaultValue = null) => { | |
if (!obj) { |
This file contains 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
from django.conf.urls import url | |
from django.core.urlresolvers import reverse_lazy | |
from django.contrib.auth.views import password_reset, password_reset_done, password_reset_confirm, password_reset_complete | |
urlpatterns = [ | |
url(r'^$', password_reset, {'post_reset_redirect' : reverse_lazy('password_reset_done')}, name="password_reset"), | |
url(r'^done/$', password_reset_done, name="password_reset_done"), | |
url(r'^(?P<uidb64>[0-9A-Za-z]+)-(?P<token>.+)/$', password_reset_confirm, {'post_reset_confirm': reverse_lazy('password_reset_complete')}, name="password_reset_confirm"), | |
url(r'^complete$', password_reset_complete, name="password_reset_complete"), | |
] |
This file contains 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
using System; | |
using System.Collections.Generic; | |
using System.Configuration; | |
using System.IO; | |
using System.Runtime.Serialization.Formatters.Binary; | |
using StackExchange.Redis; | |
using WebApp; | |
namespace ClassLib.CacheExtension |
This file contains 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
/* | |
Example for quick Java compilation and unit tests in VS Code. | |
Works well with simple BlueJ projects. | |
Hit Ctrl+Shift+B to compile currently open file with javac. | |
Hit Ctrl+Shift+T to test currently open test class. | |
See red wiggles for compilation errors / failed assertions or click exclamation mark in the status bar. | |
Uses a few workarounds for individual commands per task and filename without extension. | |
This is written for Windows but it should be easy to adopt for Linux and Mac. | |
*/ | |
{ |