Skip to content

Instantly share code, notes, and snippets.

@OscarKolsrud
OscarKolsrud / countdown-redirect.html
Created June 16, 2019 13:24 — forked from Joel-James/countdown-redirect.html
Count Down Redirect Uisng JavaScript
<!-- Modify this according to your requirement -->
<h3>
Redirecting to duckdev.com after <span id="countdown">10</span> seconds
</h3>
<!-- JavaScript part -->
<script type="text/javascript">
// Total seconds to wait
var seconds = 10;
@OscarKolsrud
OscarKolsrud / index.html
Created July 21, 2019 20:05
Postnummer autofill - Henter postnummer fra bring og autofiller en form input med det
<input type="text" pattern="\d*" class="form-control" id="postal" placeholder="0000" maxlength="4" required onkeyup="autofillCity(this.value)">
@OscarKolsrud
OscarKolsrud / install_elasticsearch_in_centos.sh
Last active November 2, 2019 22:52
Install ElasticSearch with the Cerebro UI on CentOS 6 & 7 (with or without cPanel)
#!/bin/bash
# /**
# * @version 1.0
# * @package Install ElasticSearch with the Cerebro UI on CentOS 6 & 7 (with or without cPanel)
# * @author Fotis Evangelou (https://kodeka.io)
# * @url https://engintron.com
# * @copyright Copyright (c) 2018 - 2019 Kodeka OÜ. All rights reserved.
# * @license GNU/GPL license: https://www.gnu.org/copyleft/gpl.html
# */
@OscarKolsrud
OscarKolsrud / ValidNorwegianOrganisation.php
Created November 30, 2021 23:28
Laravel validation rule to check if a business ID (organisasjonsnummer) is valid against the national registry
<?php
namespace App\Rules;
use Illuminate\Contracts\Validation\Rule;
use Illuminate\Support\Facades\Http;
class ValidNorwegianOrganisation implements Rule
{
/**