Skip to content

Instantly share code, notes, and snippets.

View c4y's full-sized avatar

Oliver Lohoff c4y

View GitHub Profile
@c4y
c4y / _README.md
Last active January 4, 2024 16:50
Entwicklungsumgebung

Allgemeines

Auf der Suche nach der "perfekten" Entwicklungsumgebung für die Webentwicklung habe ich mir meine eigene Lösung gebaut.

Folgende Ziele waren mir dabei wichtig:

  • Nutzung eines Linux-Servers
  • Einsatz von Docker (Compose)
  • keine manuelle Änderung an DNS Einträgen
  • keine manuelle Konfiguration von vHost Einträgen
@c4y
c4y / AlertWebhooks.php
Last active November 7, 2021 10:37
Service
<?php
declare(strict_types=1);
namespace Sineos\UsbWatcher\Controller\Paddle;
use Contao\CoreBundle\Framework\ContaoFramework;
use Sineos\UsbWatcher\Payment\Paddle\Webhooks\HookFactory;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\DependencyInjection\Container;
(function($) {
$('a[href*=#]:not([href=#])').click(function()
{
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
|| location.hostname == this.hostname)
{
var target = $(this.hash),
headerHeight = $(".primary-header").height() + 5; // Get fixed header height
@c4y
c4y / Megamenu_Fade_Mootools
Created March 29, 2013 18:51
Megamenu Fade Mootools
<script>
window.addEvent("domready", function() {
$$("li.submenu").each(function(el){
el.addEvent("mouseenter", function(){
el.getElement("div.submenu").setStyles({
"display": "block",
"opacity": "0",
"left": "0"
});
el.getElement("div.submenu").fade("in");
@c4y
c4y / Megamenu Fade jQuery
Last active December 15, 2015 14:09
Megamenu Fade jQuery
<script>
$(document).ready(function(){
jQuery("li.submenu").hover(
function() {
jQuery("div.submenu", this).css("display", "none");
jQuery("div.submenu", this).css("left", "0");
jQuery("div.submenu", this).fadeIn();
},
function() {
jQuery("div.submenu", this).fadeOut(function(){
@c4y
c4y / sha1.js
Created August 10, 2012 05:38
SHA1 Javascript
/**
*
* Secure Hash Algorithm (SHA1)
* http://www.webtoolkit.info/
*
**/
function SHA1 (msg) {
function rotate_left(n,s) {
@c4y
c4y / md5.js
Created August 10, 2012 05:37
MD5
/*
* md5.js 1.0b 27/06/96
*
* Javascript implementation of the RSA Data Security, Inc. MD5
* Message-Digest Algorithm.
*
* Copyright (c) 1996 Henri Torgemane. All Rights Reserved.
*
* Permission to use, copy, modify, and distribute this software
* and its documentation for any purposes and without
@c4y
c4y / gist:3311337
Created August 10, 2012 05:34
sessionStorage
// Initialize
var sds = new SessionDataStore();
// Store simple string
sds.set('foo', 'bar');
// Store object
sds.set('testobject', { foo: "bar" } );
// Get value back (will be a proper object, not just string)
var val = sds.get('testobject');
// Copy something
sds.copy('foo', 'foo2');
@c4y
c4y / youtube_channel
Created June 1, 2012 15:34
Youtube Channel einbinden
function youtube_feed_shortcode($atts)
{
// Defaults:
extract(shortcode_atts(array(
'user' => 'flamadiddle86', // youtube user
'limit' => 5, // maximum number of videos
'height' => 385, // video height
'width' => 480 // video width
), $atts));
$data = @json_decode(file_get_contents('http://gdata.youtube.com/feeds/api/users/'.$user.'/uploads?alt=json'), TRUE);
@c4y
c4y / gist:2768612
Created May 22, 2012 12:02
Eltern DIV entfernen
var children = $('remove-just-this').getChildren();
children.replaces($('remove-just-this');