Skip to content

Instantly share code, notes, and snippets.

@duikb00t
duikb00t / clone_objects.js
Last active May 6, 2020 12:39
Javascript
let x = { greeting: 'Hello', infotext: 'lorem ispum sit dolor amet' };
let y = Object.assign({}, x);
y.greeting = 'Worked';
console.log(x);
console.log(y);
/*
So... what does this o?
@duikb00t
duikb00t / laradock.md
Created September 6, 2017 11:54 — forked from tonysm/laradock.md

On using Laradock

Laradock is a community maintained set of Docker containers that we can use in our projects. Here I'm going to show what it takes to a couple of projects running usinng the same laradock setup.

Setting up

I'm not gonna be building anything new here, so I'm going to create two new laravel applications:

laravel new project-a --dev
@duikb00t
duikb00t / gist:d16820bacf4b78425cde
Created November 9, 2015 14:38 — forked from gedankennebel/gist:a4c9367cda02ad7e826f
CSS grayscale filter (go from grayscale to full color on hover) #css #sethneilson
img:hover {
-webkit-filter: grayscale(0%);
-webkit-transition: .5s ease-in-out;
-moz-filter: grayscale(0%);
-moz-transition: .5s ease-in-out;
-o-filter: grayscale(0%);
-o-transition: .5s ease-in-out;
filter: grayscale(0%);
}
@duikb00t
duikb00t / Container fluid grid
Created September 14, 2015 14:39
Responsive grid %
<style>
* {
margin: 0;
padding: 0;
}
.fluid-container-menu {
background-color: #FFFFFF;
}
@duikb00t
duikb00t / Language Switcher blade laravel
Last active September 2, 2015 11:51
Language Switcher blade laravel - add active class to the current language so you can style it with CSS.
<ul class="language_bar_chooser pull-right">
@foreach(LaravelLocalization::getSupportedLocales() as $localeCode => $properties)
<li>
@if ( $localeCode == LaravelLocalization::getCurrentLocale() )
<a class="active"rel="alternate" hreflang="{{$localeCode}}" href="{{LaravelLocalization::getLocalizedURL($localeCode) }}">{{{ $properties['native'] }}}</a>
@else
<a rel="alternate" hreflang="{{$localeCode}}" href="{{LaravelLocalization::getLocalizedURL($localeCode) }}">{{{ $properties['native'] }}}</a>
@endif
</li>
@endforeach
@duikb00t
duikb00t / autoloading
Created April 17, 2014 12:15
autoloading
<?php
require_once __DIR__.'/../vendor/autoload.php';
$app = require __DIR__.'/../src/app.php';
require __DIR__.'/../config/prod.php';
require __DIR__.'/../src/controllers.php';
$users = User::select(array('id','role','first_name','last_name'))
->where('role','like','manager')
->get(array('first_name','last_name'));
$telemarketeers = User::select(array('id','role','first_name','last_name'))
->where('role','like','telemarketeer')
->get(array('first_name','last_name'));
<div class="control-group">
<p class="pull-left">Authorised Viewers</p>
@foreach(array_chunk($users->all(), 3) as $row)
<div class="controls span2">
@foreach ($users as $user)
<label class="checkbox">
<input type="checkbox" value="option{{ $user->id }}" id="option{{ $user->id }}">{{ $user->first_name }} {{ $user->last_name }}
</label>
class SearchController extends \BaseController {
public function appendValue($data, $type, $element)
{
// operate on the item passed by reference, adding the element and type
foreach ($data as $key => & $item) {
$item[$element] = $type;
}
return $data;