Skip to content

Instantly share code, notes, and snippets.

View boh1996's full-sized avatar

Bo Thomsen boh1996

View GitHub Profile
@loschke
loschke / Bootstrap-3_Carousel-Collection
Last active March 6, 2024 15:31
Bootstrap 3 - Carousel Collection Pack
@boh1996
boh1996 / gist:3091206
Created July 11, 2012 15:36
Set object by path value
/**
* @author devman
*/
function setObjectPathValue(source, path, value) {
var parts = path.split('.'), len = parts.length, target = source;
for (var i = 0, part; i < len - 1; i++) {
part = parts[i];
target = target[part] == undefined ? (target[part] = {}) : target[part];
}
@boh1996
boh1996 / gist:3076857
Created July 9, 2012 14:24
Array mix php
<?php
/**
* This function mixes two arrays together,
* taking the keys from one and the values from the other.
* This can be usefull when doing preq match,
* so the result can be accessed like this array["key"] => value in a situation like this,
* Message: My message could be accessed like this $matches["Message"]
* @param array $keys The array containing the keys to use
* @param type $values The array containing the values to use
* @return array