Skip to content

Instantly share code, notes, and snippets.

Working from home

Henrik Oldenborg

Working from home
View GitHub Profile
Oldenborg / AssertJson.php
Last active Oct 30, 2020
Laravel test trait: assert JSON exact
View AssertJson.php
namespace Tests;
use Illuminate\Testing\TestResponse;
use Illuminate\Support\Arr;
use PHPUnit\Framework\Assert as PHPUnit;
trait AssertJson
/* @before */
Oldenborg / how-to-not-bem.scss
Last active May 28, 2020
BEM grandchildren - yes or no?
View how-to-not-bem.scss
// Example #1
.tree__branch--green {
.twig__leaf {
color: green;
// Example #2
.tree__branch--green__twig__leaf {
color: green;
View prusa-scroll-fix.html
<a href="#" onclick="document.getElementById("block-order-detail").scrollIntoView();">This is my link text</a>
Oldenborg / triangle-of-doom.js
Created Nov 12, 2018
Example of the triangle of doom
View triangle-of-doom.js
const verifyUser = function(username, password, callback){
dataBase.verifyUser(username, password, (error, userInfo) => {
if (error) {
dataBase.getRoles(username, (error, roles) => {
if (error){
}else {
dataBase.logAccess(username, (error) => {
Oldenborg / products.vue
Last active Nov 5, 2018
NetliftyCMS prerender folders
View products.vue
export default {
data() {
return {
product: Object
Oldenborg / vue.config.js
Last active Oct 2, 2018
This snippet will allow index files from the public folder to be copied to dist folder, this is nessesary in a Vue+NetlfiyCMS setup
View vue.config.js
module.exports = {
chainWebpack: config => {
.use(require('copy-webpack-plugin'), [[{
from: 'public',
ignore: ['./index.html', '.DS_Store']
Oldenborg / diode.sass
Last active Nov 22, 2017
sass / css component to make a simple diode
View diode.sass
$block: diode
$diameter: 0.5rem
width: $diameter
height: $diameter
background: $idle
display: inline-block
border: 2px solid white
margin-right: $margin_xs
View mix.sass
=vendor($attribute, $value)
-webkit-#{$attribute}: #{$value}
-moz-#{$attribute}: #{$value}
-ms-#{$attribute}: #{$value}
-o-#{$attribute}: #{$value}
#{$attribute}: #{$value}
display: inline-block
+vendor(transform, rotate(#{$deg}deg))
Oldenborg / getSpecificModelRelationships.php
Last active Sep 27, 2016
Laravel - Get Model with specific relations
View getSpecificModelRelationships.php
$clinics = new Clinic;
foreach($request->modules as $module)
$clinics = $clinics->whereHas('modules', function ($query) use ($module) {
Oldenborg / global.sass
Last active Jan 16, 2021
Remove antpaths from focused elements
View global.sass
// Remove antpaths from focused elements
outline: medium none !important
outline: 0