Skip to content

Instantly share code, notes, and snippets.

:octocat:
Out sick

Christopher Dosin ChristopherDosin

:octocat:
Out sick
Block or report user

Report or block ChristopherDosin

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
@ChristopherDosin
ChristopherDosin / jquery.sticky-element.js
Created Jan 3, 2019
Shopware jQuery sticky element
View jquery.sticky-element.js
/**
* Sticky plugin to add a class based on the
* scroll position.
*/
$.plugin('swStickyElement', {
defaults: {
/**
* The css class for the sticky element.
*
* @property stickyCls
View promise-take-at-least.js
// Creates a new promise that automatically resolves after some timeout:
Promise.delay = function (time) {
return new Promise((resolve, reject) => {
setTimeout(resolve, time)
})
}
// Throttle this promise to resolve no faster than the specified time:
Promise.prototype.takeAtLeast = function (time) {
return new Promise((resolve, reject) => {
@ChristopherDosin
ChristopherDosin / installc9.sh
Created Jul 17, 2018
Simple script to install Cloud9 on an Ubuntu Server
View installc9.sh
#!/bin/bash
# Simple script to install Cloud9 on an Ubuntu Server
apt-get update && apt-get install build-essential -y
apt-get install git -y
apt-get install nodejs -y
apt-get install npm -y
apt-get install python2.7 python-pip -y
# cd ~/to/your/directory
View ajaxform.js
$('#id-form button[type=submit]').click(function(e){
e.preventDefault();
$(this).text('Einen moment...');
var form = jQuery(this).parents("form:first");
var dataString = form.serialize();
var formAction = form.attr('action');
$.ajax({
View gist:0da262095d45806dac383560007ccfbe
{
"ace": {
....
"custom-types": {
"json()": {
"tpl": "smarty"
}
}
@ChristopherDosin
ChristopherDosin / array.pug
Created Jan 25, 2018
Bilder ausgeben aus Array
View array.pug
section.seasonselement
ul
each season in seasons
li
input(type="radio" name="slide")
label
-var seasonPic = season["picture"]
div(style="background-image: url(" + seasonPic["src"]+")")
.accslide(style="background-color: " + season["backgroundColor"])
.content
@ChristopherDosin
ChristopherDosin / custom.js
Created Sep 15, 2016
Shopware Altersabfrage Modal
View custom.js
// check if cookie exist
if(!Cookies.get('of_age1')) {
// if not open the modal
$.modal.open('<div style="padding:20px">'+
'<p>Bist du schon über 18 Jahre alt?</p>'+
'<button class="btn">Ja ich bin über 18</button>'+
'</div>',{
title: 'Bist du schon 18?',
additionalClass: 'of_age',
width: 300,
@ChristopherDosin
ChristopherDosin / php_object_to_array.php
Created May 3, 2017 — forked from victorbstan/php_object_to_array.php
recursively cast a PHP object to array
View php_object_to_array.php
<?php
/*
This function saved my life.
found on: http://www.sitepoint.com/forums//showthread.php?t=438748
by: crvandyke
It takes an object, and when all else if/else/recursive functions fail to convert the object into an associative array, this one goes for the kill. Who would'a thunk it?!
*/
$array = json_decode(json_encode($object), true);
@ChristopherDosin
ChristopherDosin / index.tpl
Last active Oct 26, 2016
frontend/detail/index.tpl
View index.tpl
{extends file='parent:frontend/detail/index.tpl'}
{block name='frontend_detail_data_attributes' append}
{* Product attribute 4 *}
{block name='frontend_detail_data_attributes_attr4'}
{if $sArticle.attr4}
<li class="base-info--entry entry-attribute">
<strong class="entry--label">
{s name="DetailAttributeField4Label"}{/s}:
You can’t perform that action at this time.