Skip to content

Instantly share code, notes, and snippets.

View dtomasi's full-sized avatar

Dominik Tomasi dtomasi

  • Waldshut-Tiengen, Germany
  • 10:41 (UTC +02:00)
View GitHub Profile
@dtomasi
dtomasi / default
Last active December 8, 2023 04:20
Brew Nginx PHP7
server {
listen 80;
server_name localhost;
root /Users/YOUR_USERNAME/Sites;
access_log /Library/Logs/default.access.log main;
location / {
include /usr/local/etc/nginx/conf.d/php-fpm;
}
@dtomasi
dtomasi / clone-hdd.sh
Last active May 13, 2020 18:31
Backup and Restore HDD Linux
## Create disk image
##
## 1. Boot from a liveCD or liveUSB.
## 2. Make sure no partitions are mounted from the source hard drive.
## 3. Mount the external HD
## 4. Backup the drive.
dd if=/dev/hda conv=sync,noerror bs=64K | gzip -c > /mnt/sda1/hda.img.gz
## Restore the Disk
@dtomasi
dtomasi / camel-kebab.js
Created April 18, 2017 09:45
CamelCase to kebab-case and backwards
/**
* Convert Strings from camelCase to kebab-case
* @returns {string}
* @param input
*/
static camelToKebab(input: string) {
return input.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
}
/**
@dtomasi
dtomasi / StickyNav.js
Last active August 31, 2018 20:02
StickNav pins navigation-bars to the top if scrolling over it.
/**
* jQuery Plugin StickyNav
* @copyright tomasiMEDIA 2013
* @author Dominik Tomasi
* @date 09.10.13
*/
(function ($) {
@dtomasi
dtomasi / getUrlsFromChildren.js
Last active August 31, 2018 20:01
get all urls from all children of element
/**
* Plugin for Loading urls eg. href-attribute from children of an Element
* may be to get all Links from a Navigation
*
* @copyright tomasiMEDIA 2013
* @author Dominik Tomasi
* @date 09.10.13
*
*/
@dtomasi
dtomasi / getObjectLenght.js
Last active August 31, 2018 20:01
get length on an Object
/**
* Global function for Counting length of an Object
* @copyright tomasiMEDIA 2013
* @author Dominik Tomasi
* @date 09.10.13
*/
(function($,window){
$.fn.objectLength = function(){
@dtomasi
dtomasi / Timer.php
Last active August 31, 2018 20:01
Timer-Class for Testing speed of PHP-Scripts or find speed brake
<?php
/**
* Timer vor Testing PHP-Scripts
* @copyright tomasiMEDIA 2013
* @author Dominik Tomasi
* @date 09.12.13
*
* usage:
* Timer::start();
@dtomasi
dtomasi / Vererbung.js
Created January 10, 2014 10:25
Vorlage für einen Klassenaufbau in Javascript
/**
* Vorlage für Klassenaufbau mit Vererbung in Javascript
* @constructor
*/
/**
* Define Class ParentClass
* @constructor
*/
function ParentClass() {
@dtomasi
dtomasi / ToolTipPlugin.js
Created December 27, 2013 10:32
ToolTip-Plugin
/**
* jQuery Plugin ToolTip
* @copyright tomasiMEDIA 2013
* @author Dominik Tomasi
* @date 27.12.13
*/
var ToolTipPlugin = {
@dtomasi
dtomasi / ContentLoader.js
Last active August 31, 2018 19:59
ContentLoader loads HTML from given UrlObject via Ajax. It returns all data via complete-Function if all ist recieved. onlyContainer-Option allows to fetch a specified Element from Url eg. returns only specified element.
/**
* JQuery Plugin ContentLoader
* @copyright tomasiMEDIA 2013
* @author Dominik Tomasi
* @date 09.10.13
*/
(function($,window){
$.ContentLoader.defaultOptions = {