Skip to content

Instantly share code, notes, and snippets.

View serjoscha87's full-sized avatar

Serjoscha serjoscha87

  • Aachen, NRW, Germany
View GitHub Profile
@serjoscha87
serjoscha87 / position-responsive.css
Created May 30, 2023 20:22
Bootstrap (4+) like responsive position classes
.position-static {
position: static !important;
}
.position-fixed {
position: fixed !important;
}
.position-absolute {
position: absolute !important;
<?php
class CockpitHelper {
public static $_COCKPIT_RESTAPI_TOKEN = null;
public static $_COCKPIT_BACKEND_URL = null;
public static $_COCKPIT_ADMIN_RESTAPI_TOKEN = null;
public static $_ASC = 1;
public static $_DESC = -1;
/**
*
@serjoscha87
serjoscha87 / index.html
Created September 29, 2016 18:26
JS: Messing with other peoples head - or how to complicate a dual switch case
<!-- ... html html html -->
<script src="vendor.js"></script>
<script src="switch.js"></script>
<script src="another_vendor.js"></script>
<script src="switch.js"></script>
<!-- html html html... -->
@serjoscha87
serjoscha87 / Singleton.class.php
Last active August 29, 2015 14:06
This simple Singleton PHP-Class enables an easy *encapsulating of class attributes and methods* with the benefit of standard Singleton "features" (no need of an instance). The only clue: encapsulating! That enables to hide attributes and even methods for the user of your class (which extends the simple Singleton class). On this way you are able …
class Singleton {
protected static $inst = null;
protected static function getInstance($c2i) {
if(self::$inst === null)
self::$inst = new $c2i;
return self::$inst;
}
}