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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
<!-- CSS only --> | |
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous"> | |
</head> | |
<body class="p-5" onload="renderLog(document.getElementById('the-log').value)"> |
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
document.write( | |
[...document.querySelectorAll('img')] | |
.filter(node => node.src?.indexOf('qa.jollyroom.se') > -1) | |
.map(node => node.src.split('?')[0].replace('qa.jollyroom.se', 'qa.jollyroom.shimmercat.cloud')) | |
.map(shimmerCatSrc => '<img src="'+shimmerCatSrc+'">').join('') | |
); |
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
// Turn our form data into a JSON string | |
const data ={ | |
... | |
data: { | |
... | |
integrations: [ | |
{type: 'integrationX' ... }, | |
{type: 'integrationY' ... } | |
] | |
} |
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
public SomethingController([FromBody] MyDataModel model) { | |
try { | |
DoTheStuff(model); | |
} catch (SpecificExceptionIKnowCanHappen exc) { | |
return BadRequest(new { errorCode = ErrorCode }); | |
} | |
// all other exceptions will let the app crash, exception info will be sen to log and app returns status 500 to the client | |
return Ok(); | |
} |
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
// Controller exempel | |
public class AccountController : Controller | |
{ | |
public async Task<IActionResult> kollaStatusPåBankIdInloggningen(string reference) { | |
// ... massa saker händer... | |
AuthResult result = authClient.AuthorizeReference(...) |
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
$.formUtils.addValidator({ | |
name: 'statement', | |
validatorFunction : function(value, $elem, conf, language, $form, eventContext) { | |
var statementIsValid = true, | |
$resultTree = $('<result><node></node></result>'), | |
$current = $resultTree.children().eq(0), | |
invokeNext = true; | |
$.each(value.replace(/\s+/g,' ').split(' '), function (i, str) { | |
if (str == '||') { | |
invokeNext = true; |
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
<?php | |
interface State { | |
public function getState(); | |
} | |
abstract class StateAbstract implements State { | |
const STATE_INIT = 'STATE_INIT'; |
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
<?php | |
namespace Routing\Auth; | |
abstract class AuthChecker { | |
const SKIPPED; | |
const SUCCESS; | |
const AUTHENTICATION_FAILED; | |
const AUTHORIZATION_FAILED; | |
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
<?php | |
/** | |
* | |
* @example | |
* <?php | |
* | |
* class Day extends EnumeratedType | |
* { | |
* const MONDAY = 'Monday'; |
NewerOlder