Skip to content

Instantly share code, notes, and snippets.

View dazz's full-sized avatar

Anne-Julia Seitz dazz

View GitHub Profile
@dazz
dazz / cd.yml
Last active December 1, 2022 22:57
medium_github-actions-push-ghcr
name: Continuous Delivery
on:
push:
branches:
- 'main'
tags:
- 'v*.*.*'
jobs:
build:
{
"title": "c-ephalogram",
"blocks": {
"temp/nerd": {
"type": "text",
"name": "thermometer",
"topic": "core/nerd/temp",
"initialValue": 23.42,
"unit": "celsius",
"description": "Temperature in Nerdarea",
@dazz
dazz / addlicense.sh
Created January 22, 2014 11:43
add license header to all files
#!/bin/bash
find . -name '*.php' -type f | while read files
do
sedtest=$(sed -n '/^/,/$/p' "${files}" | sed -n '/<?php/p')
if [ "${sedtest}" ]
then
echo ${files}
@dazz
dazz / composer_hhvm_phpunit.history
Last active December 28, 2015 06:48
Running phpunit on composer with hhvm
(~/code) % hhvm --version HipHop VM v2.2.0 (rel)
Compiler: heads/HPHP-2.2-0-g633422a8386feb6cce6aa533a12d24d5c32b526c
Repo schema: 63eda7c0b41603cdee7081a57d6f45d691ad206e
(~/code) % hhvm --repo-schema 63eda7c0b41603cdee7081a57d6f45d691ad206e
(~/code/composer) % git clone https://github.com/composer/composer.git Cloning into 'composer'...
remote: Counting objects: 27010, done.
remote: Compressing objects: 100% (15944/15944), done.
remote: Total 27010 (delta 13980), reused 22055 (delta 9153)
Receiving objects: 100% (27010/27010), 5.96 MiB | 674 KiB/s, done.
Resolving deltas: 100% (13980/13980), done.
var_dump(json_encode(
array()
));
// [ ]
var_dump(json_encode(
array('foo')
));
// ["foo"]
@dazz
dazz / print_pre.php
Created September 25, 2013 14:40
pretty print
function print_pre($var, $doDie = true) {
echo "<pre>";
print_r($var);
echo "</pre>";
if ($doDie) {
die('i-die');
}
}
<?php
$tests = array(
array('{"test":""}', 2),
array('{"test": {}}', 3),
array('{"test": {}, "test2": ""}', 3),
array('{"test": {}, "test2": {}}', 3),
array('{"test": {}, "test2": {"test3": ""}}', 3),
array('{"test": {}, "test2": {"test3": {}}}', 4),

Awesome PHP

A list of amazingly awesome PHP libraries, resources and shiny things.

Composer

<?php
/**
* Class casting
*
* @param string|object $destination
* @param object $sourceObject
* @return object
*/
function cast_long($destination, $sourceObject)
(empty line)
Notes:
* http://link-to-PR-.de - What has been solved
* http://link-to-PR-.de - What has been solved