Skip to content

Instantly share code, notes, and snippets.

View Stephan123's full-sized avatar

Krauß Stephan Stephan123

View GitHub Profile
@Stephan123
Stephan123 / txt
Last active January 21, 2019 08:16
Test
aaaa
bbbb
cccc
@Stephan123
Stephan123 / pre-commit_hook
Created July 17, 2018 13:12
#hook #git pre-commit Hook zur statischen Software Analyse
#!/usr/bin/php
<?php
// copied from https://gist.github.com/chelmertz/816166
// authored by Travis Swicegood
// modified by Daniel Pinto and Israel Trindade
class Enable
{
const PHP_LINT = true;
@Stephan123
Stephan123 / vererbung_class.php
Created May 30, 2018 16:25
#class Test der Vererbung von Klassen parent class -> child class
<?php
class db{
protected $tabelle = 'leer';
public function setTabelle($tabelle){
$this->tabelle = $tabelle;
}
public function getTabelle(){
@Stephan123
Stephan123 / json_fussball_validate.json
Created May 15, 2018 05:33
#json Validierung eines JSON Objektes, Beispiel Fußballer
// player_json_schema
{
"type": "object",
"properties": {
"first_name": { "type": "string" },
"last_name": { "type": "string" },
"age": { "type": "integer" },
"club": {
"type": "object",
@Stephan123
Stephan123 / json_array_validate.json
Created May 14, 2018 06:28
#json Validierung eines JSON Array
-- JSON Array
[
{"id": 1,
"name": "Milk",
"stock": 25},
{"id": 2,
"name": "Yogurt",
"stock": 15,
"link": "http://delicious-yogurt.com"}
]
@Stephan123
Stephan123 / replace_column.sql
Last active May 7, 2018 15:06
#mysql ersetzen des Inhaltes einer Spalte mit Replace
update test t set t.email = replace(t.email, 'ww-energie.com', 'blub.com');
-- select t.email as mail, replace(t.email, 'eon-westfalenweser.com' , 'ww-energie.com') as test from users t where t.email like '%eon-westfalenweser.com'
-- update users t set t.email = replace( t.email, 'eon-westfalenweser.com', 'ww-energie.com' );
-- select count(*) from esbaccounts t where t.login like '%ww-energie.com';
-- update esbuserdetails t set t.demail = replace( t.demail, 'eon-westfalenweser.com', 'ww-energie.com' ) where t.demail like '%eon-westfalenweser.com';
@Stephan123
Stephan123 / prepare_commit_msg.sh
Created May 4, 2018 10:01
#git #hook Prepare Commit Message Hook , Übernahme des Branch
#!/bin/sh
#
# Automatically add branch name and branch description to every commit message except merge commit.
#
COMMIT_EDITMSG=$1
addBranchName() {
NAME=$(git branch | grep '*' | sed 's/* //')
DESCRIPTION=$(git config branch."$NAME".description)
@Stephan123
Stephan123 / index.html
Created April 20, 2018 07:13
#buch Barcode Reader mit Html 5, Bootstrap und QuaggaJS
<!-- Bootstrap Bereich -->
<div class="row">
<div class="col-lg-6">
<div class="input-group">
<input id="scanner_input" class="form-control" placeholder="Click the button to scan an EAN..." type="text" />
<span class="input-group-btn">
<button class="btn btn-default" type="button" data-toggle="modal" data-target="#livestream_scanner">
<i class="fa fa-barcode"></i>
</button>
@Stephan123
Stephan123 / abacus.js
Created April 20, 2018 07:07
#schule online interaktive Abakus Abacus
// Copyright (C) Thorsten Thormaehlen, Marburg, 2013, All rights reserved
// Contact: www.thormae.de
// This software is written for educational (non-commercial) purpose.
// There is no warranty or other guarantee of fitness for this software,
// it is provided solely "as is".
function UIElement(x, y, width, height, type, ref, subref, slotType) {
this.x = x;
this.y = y;
@Stephan123
Stephan123 / regex_email.txt
Created April 13, 2018 11:01
#regex Mai Email
^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$.