Skip to content

Instantly share code, notes, and snippets.

💪
2020: commit every day

Henrik Oldenborg

💪
2020: commit every day
Block or report user

Report or block Oldenborg

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Oldenborg
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
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) {
callback(error)
}else{
dataBase.getRoles(username, (error, roles) => {
if (error){
callback(error)
}else {
dataBase.logAccess(username, (error) => {
@Oldenborg
Oldenborg / products.vue
Last active Nov 5, 2018
NetliftyCMS prerender folders
View products.vue
<template>
...
</template>
<script>
export default {
data() {
return {
product: Object
}
@Oldenborg
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 => {
config
.plugin('copy')
.use(require('copy-webpack-plugin'), [[{
from: 'public',
ignore: ['./index.html', '.DS_Store']
}]])
}
}
@Oldenborg
Oldenborg / diode.sass
Last active Nov 22, 2017
sass / css component to make a simple diode
View diode.sass
$block: diode
$diameter: 0.5rem
+component
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}
=rotate($deg)
display: inline-block
+vendor(transform, rotate(#{$deg}deg))
@Oldenborg
Oldenborg / getSpecificModelRelationships.php
Last active Sep 27, 2016
Laravel - Get Model with specific relations
View getSpecificModelRelationships.php
<?php
$clinics = new Clinic;
if($request->modules)
{
foreach($request->modules as $module)
{
$clinics = $clinics->whereHas('modules', function ($query) use ($module) {
$query->where('modules.id',$module);
});
}
@Oldenborg
Oldenborg / global.sass
Created Sep 18, 2016
Remove antpaths from focused elements
View global.sass
// Remove antpaths from focused elements
a:focus,
select:focus
outline: medium none !important
button::-moz-focus-inner,
select::-moz-focus-inner
border: 0 none !important
@Oldenborg
Oldenborg / ToggleTrait.php
Created Sep 8, 2016
Laravel - Boolean toggle trait
View ToggleTrait.php
<?php namespace App\Traits;
trait ToggleTrait
{
public function toggle($values, $bool = null)
{
if(is_string($values))
{
$values = [$values];
You can’t perform that action at this time.