Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View jankal's full-sized avatar
🏡
Working from home.

Alexander Jank jankal

🏡
Working from home.
View GitHub Profile
@jankal
jankal / Luhn.php
Last active May 22, 2016 16:59
A PHP class for checking numbers trough the popular Luhn algorithm. It's also able to get the digit which you'll have to add that then Lun-check gets true.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
<?php
class Luhn {
public static function getDigit($number) {
$number .= 0;
$result = self::calc($number);
return (10 - $result);
}
@jankal
jankal / Process.php
Last active October 10, 2022 03:05
PHP Process class
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
<?php
/**
* @compability: Linux only. (Windows does not work).
* @author: Alexander Jank <himself@alexanderjank.de>
*/
class Process{
private $pid;
@jankal
jankal / packAnonFunction.php
Last active May 22, 2016 17:02
pack a anonimous function into a string (for transmissen)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
<?php
class TestClass {
function getClosure() {
return function () {
var_dump($this);
};
}

Keybase proof

I hereby claim:

  • I am jankal on github.
  • I am jankal (https://keybase.io/jankal) on keybase.
  • I have a public key ASB13WTOIo70Q4t36xcE0V-fvMl7kT5OO27LpS2mTFuuZQo

To claim this, I am signing this object:

@jankal
jankal / openpgp.txt
Created March 17, 2016 16:16
Verknüpfte OpenKeychain-Identität
Dieses Gist bestätigt die Verknüpfte-Identität innerhalb meines OpenPGP-Schlüssels und verknüpft es mit diesem GitHub-Benutzerkonto.
Token des Nachweises:
[Verifying my OpenPGP key: openpgp4fpr:6aeb406d0e3dc6e8c2e466d92e12039a49e3d70b]
@jankal
jankal / git-parser.php
Created March 20, 2016 12:20
Parse outputs of `git log`
<?php
function parseLog($log) {
$lines = explode("\n", $log);
$history = array();
foreach($lines as $key => $line) {
if(strpos($line, 'commit') === 0 || $key + 1 == count($lines)){
if(!empty($commit)){
$commit['message'] = substr($commit['message'], 4);
array_push($history, $commit);
unset($commit);
@jankal
jankal / git_history.php
Last active March 20, 2016 12:24 — forked from geeknam/git_history.php
Parse git log with PHP to an array
<?php
// Author: Ngo Minh Nam
$dir = "/path/to/your/repo/";
$output = array();
chdir($dir);
exec("git log", $output);
$history = array();
foreach($lines as $key => $line) {
if(strpos($line, 'commit') === 0 || $key + 1 == count($lines)){
@jankal
jankal / stacktrace.php
Created March 9, 2017 14:53
LOL stacktrace
PHP Stack trace:
PHP 1. {main}() C:\Users\Alexander Jank\Projekte\flimliste\parse_test.php:0
PHP 2. file_put_contents() C:\Users\Alexander Jank\Projekte\flimliste\parse_test.php:4
Warning: file_put_contents(stdClass Object
(
[Filmliste] => Array
(
[0] => Sender
[1] => Thema
@jankal
jankal / dev.scss
Last active March 20, 2018 05:50
zeraton.de dev styles
$color-primary: #134074;
$color-primary-light: #8da9c4;
$color-grey-dark: #878787;
$color-white: #fbfdfb;
$color-black: #000000;
@keyframes moveInLeft {
0% {
opacity: 0;
transform: translateX(-100px);
@jankal
jankal / dev.scss
Created March 21, 2018 21:09
Full SCSS of bug-report
$color-primary: #134074;
$color-primary-light: #8da9c4;
$color-grey-dark: #878787;
$color-white: #fbfdfb;
$color-black: #000000;
.slideInRight {
animation: slideInRight 6s cubic-bezier(0.250, 0.460, 0.450, 0.940) both;
@keyframes slideInRight {