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
class InfiniteScrollLinkPager extends CLinkPager
{
public $htmlOptions=array();
/**
* Initializes the pager by setting some default property values.
*/
public function init()
{
<?php
/**
* Feb 2014
* @author Pascal Brewing
* @email <[email protected]>
* @package common\helpers
* Class MediaContentHelper
*/
namespace common\modules\mediating\helpers;
@igorw
igorw / vm.php
Last active August 29, 2015 14:03
My stack machine from cute little interpreters at dpc14.
<?hh
// examples:
//
// ~$ echo '1 jnz(:start) :foo call(:bar) ret :bar 42 print ret :start call(:foo)' | hhvm vm.php
// float(42)
//
// ~$ echo '3 :loop 1 - print jnz(:loop)' | hhvm vm.php
// float(2)
// float(1)
@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'.
@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.

@addyosmani
addyosmani / README.md
Last active August 24, 2025 14:34 — 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

@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>
@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 ""
@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
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