Skip to content

Instantly share code, notes, and snippets.

View daslicht's full-sized avatar

Marc Wensauer daslicht

View GitHub Profile
@daslicht
daslicht / VideoStream.php
Created July 14, 2021 09:02 — forked from ranacseruet/VideoStream.php
PHP VideoStream class for HTML5 video streaming
<?php
/**
* Description of VideoStream
*
* @author Rana
* @link http://codesamplez.com/programming/php-html5-video-streaming-tutorial
*/
class VideoStream
{
private $path = "";
#!/bin/bash
#Copyright 11.11.13 Michell Gailing <gailing.michell@gmail.com>
#It's Licensed under DWWWI 'Do whatever you want with it!'
wget http://www.okean.com/chinacidr.txt
sed -i '1,4d' chinacidr.txt
sed -i 's/ China//g' chinacidr.txt
ipset create china hash:net
while read line; do ipset add china $line; done < chinacidr.txt
iptables -I INPUT -m set --match-set china src -j DROP
rm chinacidr.txt
<?php
$countries = array
(
'AF' => 'Afghanistan',
'AX' => 'Aland Islands',
'AL' => 'Albania',
'DZ' => 'Algeria',
'AS' => 'American Samoa',
'AD' => 'Andorra',

SilverStripe SkyScrapers Example

simple example of DataObjects
managed with ModelAdmin
filterable in the frontend

prod:
rm -rf ./bundle
mrt bundle bundle.tgz > /dev/null
tar -xzf bundle.tgz
rm -r bundle/server/node_modules/fibers
cd bundle/server && npm install fibers@1.0.0
clean:
rm -f ./bundle.tgz
rm -rf ./bundle
<?php
namespace ME\MainPageBundle\Response;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\Form\Form;
class FormErrorResponse extends JsonResponse {
public function __construct(Form $form, $status = 400, $headers = array()) {
$errors = $this->getFormErrors($form);