Skip to content

Instantly share code, notes, and snippets.

View bartrail's full-sized avatar

Conrad Barthelmes bartrail

View GitHub Profile
@bartrail
bartrail / app.js
Last active July 11, 2018 15:21
FontAwesome 5.0 wrapper component for a default prefix
import Vue from 'vue';
import {default as fa} from 'fontawesome.vue';
(function(window) {
"use strict";
// register our custom FontAwesome component globally
Vue.component('fa', fa);
new Vue({
@bartrail
bartrail / gist:4534893
Last active December 11, 2015 02:59
This is a plugin for the famous RoyalSlider by Dmitry Semenov. It adds HTML5 History API support for sliding through images or content. Basically it replaces the deeplinking plugin - which is already great and very much useful for most cases. But I needed named urls and more custom features, also Dimitry suggests to build an own plugin, well her…
(function($) {
/**
*
* This plugin is released under the MIT Licene (http://opensource.org/licenses/MIT)
*
* RoyalSlider HTML5 HistoryApi Plugin by Conrad Barthelmes
*
* @requires RoyalSlider http://dimsemenov.com/plugins/royal-slider/
* @requires History.js API https://github.com/balupton/History.js/
* - bundled jquery.history.js for html4+html5 support
@bartrail
bartrail / localStorageHandler
Created June 6, 2012 14:15
a Simple local storage handler using jStorage and jQuery. Use it to save objects/arrays under one namespace with a customized object structure
var localStorageHandler = function(namespace, dataStructure) {
this.namespace = namespace;
this.dataStructure = dataStructure ? dataStructure : {};
this.saveItem = function(id, data) {
var oldData = this.getItem(id);
var saveData = $.extend(true, {}, oldData, data);
@bartrail
bartrail / Country.php
Created October 6, 2011 16:34
Country Class with incrementing userAmount
<?php
namespace Application\LocationBundle\Document;
use Doctrine\ODM\MongoDB\Mapping\Annotations as MongoDB;
use Symfony\Component\Validator\Constraints as Assert;
use Gedmo\Mapping\Annotation as Gedmo;
use Doctrine\ODM\MongoDB\SoftDelete\SoftDeleteable;
use Gedmo\Translatable\Translatable;
{# MyBundle/Resources/view/JavaScript/localized.js.twig #}
<script type="text/javascript">
/**
* template for dynamic translations and urls for js
*/
var localize = {
inlineEdit: {
tooltip: '{{ "user.profile.edit.tooltip" | trans }}',
submit: '{{ "user.profile.edit.submit" | trans }}',
<?php
/**
* {@inheritdoc}
*/
public function loadMetadataForClass($className, ClassMetadataInfo $class)
{
$reflClass = $class->getReflectionClass();
$documentAnnots = array();
@bartrail
bartrail / gist:1066856
Created July 6, 2011 08:48
loadMetadataForClass in Doctrine MongoDB ODM AnnotationDriver.php
/**
* {@inheritdoc}
*/
public function loadMetadataForClass($className, ClassMetadataInfo $class)
{
$reflClass = $class->getReflectionClass();
$documentAnnots = array();
foreach ($this->reader->getClassAnnotations($reflClass) as $annot) {
<meta charset="utf-8">