Skip to content

Instantly share code, notes, and snippets.

View cebe's full-sized avatar
☁️
working on cebe.cloud

Carsten Brandt cebe

☁️
working on cebe.cloud
View GitHub Profile
@greydnls
greydnls / default.php
Created June 18, 2015 16:14
Default Object
public function amazingFunction(CoolObjectInterface $object = new SlightlyColdObject())
{
$this->object = $object;
}
public function notAsAmazingFunction(BlahObjectInterface $object = null)
{
if ($object == null) $this->object = new BoringObject();
}
@ShNURoK42
ShNURoK42 / MyParsedown
Last active February 6, 2023 20:18
Mention for Parsedown
<?php
class MyParsedown extends \Parsedown
{
function __construct()
{
$this->InlineTypes['@'][]= 'UserMention';
$this->inlineMarkerList .= '@';
}
@auroraeosrose
auroraeosrose / gist:d038ec0f9fc82985fe06
Created February 26, 2015 16:36
Go PHP7(ext) - What we're doing

A quick snapshot of what is going on with the project - for the tl;dr see "what can I do?"

What is complete

  1. A name- GoPHP7 is a project (not yet really started) to motivate people to migrate to PHP7 when it's released. This echoes the GoPHP5 project of the past
  2. An irc channel - registered on freenode - owner auroraeosrose, ops lornajane, ircmaxell and joepferguson
  3. A set of goals - see http://goo.gl/BJ3s8D

What is in process

  1. Getting "adminy" stuff set up (lornajane is in charge) - This will include website, wikis, twitter, whatever, and other tools
PHP7 is coming
And it's breaking all of our extensions
There are currently more changes to the internal apis than there are to things that users will see (and there are enough of those)
In fact not even all the extensions in php source proper are all the way PHP7'd - most of PECL and extensions hosted elsewhere haven't even started! Heck half don't have maintainers!
Extensions are also notorious for poor api design, poor testing, and non-existent docs
But they're also powerful, useful, and fast and more people should use them
PHP7 is coming - fast - and we have a chance to "break" things and to get the community interested and involved
@mxm
mxm / pre-push
Last active August 29, 2015 14:13
pre-push hook for Flink commiters
#!/bin/bash
####
##
## Pre-push hook which protects a remote branch
## by running a verify command before pushing.
##
## Should be place in .git/hooks/pre-push
##
## protected_remote can be a substring
@pabluk
pabluk / boot-lxc-salt-formula.sh
Created December 25, 2014 19:10
Create a container LXC to test salt formulas on Debian
#!/bin/bash
PROJECT_DIR=$(pwd)
CNAME=$1
CNAME_ROOTFS=/var/lib/lxc/$CNAME/rootfs
usage() {
echo "Usage: `basename $0` <container-name>"
echo ""
@konstantint
konstantint / spawn.cpp
Created November 14, 2014 17:28
Example of communication with a subprocess via stdin/stdout
//
// Example of communication with a subprocess via stdin/stdout
// Author: Konstantin Tretyakov
// License: MIT
//
#include <ext/stdio_filebuf.h> // NB: Specific to libstdc++
#include <sys/wait.h>
#include <unistd.h>
#include <iostream>
@addyosmani
addyosmani / README.md
Last active April 23, 2025 11:39 — forked from 140bytes/LICENSE.txt
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

@tom--
tom-- / MVC or not.md
Last active August 29, 2015 14:06
Will Yii show down your web site?

Will Yii slow down your web site?

The following question appeared out of the blue in #yii on Freenode in September 2014:

hi i have started working on yii framework... and other pople have been continuously telling me that its a bad decision and using yii will slow down the site and performance will not be good, better go for core php...any of your thoughts will be great help..cheers

How much penalty is there in using an MVC framework such as Yii?

There is no way to really answer the question because it depends so heavily on the specific application, the technologies involved and their deployment. Plenty of attempts have been made to benchmark different MVCs but the results are usually perfectly irrelevant to any given application. It would be a foolish mistake to think that data from, for example, TechEmpower's Web Framework Benchmarks would predict relative performance of your web site.

@giuliano108
giuliano108 / check_ssl_certificate.pl
Created July 15, 2014 08:27
Nagios SSL Certificate check, with SNI (SSL virtual hosting) support
#!/usr/bin/perl
=head1 SYNOPSIS
check_ssl_certificate.pl
--url,-u URL
--sni_servername,-s HOSTNAME SNI servername (SSL vhost) that will be requested during SSL handshake.
This tells the server which certificate to return.
--warning,-W days Warning alert if the cert expires in less than `days'.
--critical,-C days Critical alert if the cert expires in less than `days'.