Skip to content

Instantly share code, notes, and snippets.

View seyfer's full-sized avatar
💭
pet the duck until exploded

Oleg Abrazhaev seyfer

💭
pet the duck until exploded
View GitHub Profile
@sudar
sudar / dotdeb.sh
Created January 25, 2011 16:48
Adding dotdeb repository to apt-get source list to install PHP 5.3.x. More details at http://sudarmuthu.com/blog/2011/01/25/installing-php-5-3-x-in-ubuntu-through-apt-get-or-aptitude.html
gpg --keyserver keys.gnupg.net --recv-key 89DF5277
gpg -a --export 89DF5277 | sudo apt-key add -
@M1zh0rY
M1zh0rY / auntAsya.php
Created April 11, 2012 14:03
Тетя ася
<?php
/**
* @name Aunt Asya has arrived =)
* @author M1zh0rY
* @category js clear script
* Infected Script:
* JS/Agent.* (all, ESET)
* JS/Kryptik.LP (ESET)
* Trojan:JS/BlacoleRef.BC (MCE)
* @license GNU
@juneym
juneym / php-gearman-worker-nonblocking
Created September 14, 2013 04:07
PHP Gearman Worker (non-blocking) -- based on the PHP doc.
<?php
declare(ticks = 1);
$terminate = false;
pcntl_signal(SIGTERM, function() use (&$terminate) {
$terminate = true;
echo "Terminating = true \n";
});
@kabel
kabel / ocp.php
Last active September 20, 2016 14:31 — forked from ck-on/ocp.php
<?php
/*
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP)
Author: _ck_ (with contributions by GK, stasilok, n1xim, pennedav, kabel)
Version: 0.2.0
Free for any kind of use or modification, I am not responsible for anything, please share your improvements
* revision history
0.2.0 0000-00-00 Updated page layout/styles and restructure code to be more MVC-like (kabel)
implemented HTTP Basic authentication (pennedav)
@CMCDragonkai
CMCDragonkai / negabase.php
Last active March 9, 2017 04:18
PHP: Negative Base Conversion from Base 10 Decimal
<?php
/**
* Negabase
* To convert a decimal to negative base.
* Divide the number by the negative base.
* Acquire the whole number quotient and remainder.
* If the remainder is negative, add 1 to the quotient and add the absolute value of the base to the remainder.
* Divide the quotient by the negative base... rinse and repeat until the quotient is 0.
* Aggregate the remainders in reverse (as a stack), and you have your negative base representation.
@dework
dework / MenuBuilder.php
Created December 1, 2012 18:18
Symfony 2 breadcrumbs based on KnpMenuBundle
<?php
namespace Chyrius\PublicBundle\Menu;
use Knp\Menu\FactoryInterface;
use Symfony\Component\HttpFoundation\Request;
use Chyrius\PublicBundle\Menu\RequestVoter;
use Symfony\Component\DependencyInjection\ContainerInterface;
class MenuBuilder
@seyfer
seyfer / apn-server.php
Last active October 11, 2017 10:29 — forked from samvermette/apn-server.php
Quickly send an Apple Push Notification using PHP
<?php
$apnsHost = 'gateway.sandbox.push.apple.com';
$apnsCert = 'ck.pem';
$apnsPort = 2195;
$apnsPass = '<PASSWORD_GOES_HERE>';
$token = '<DEVICE_TOKEN_GOES_HERE>';
$payload['aps'] = array('alert' => 'Oh hai!', 'badge' => 1, 'sound' => 'default');
$output = json_encode($payload);
@cpliakas
cpliakas / ant-composer.xml
Created November 26, 2013 01:20
Apache Ant tagets for Composer commands.
<?xml version="1.0" encoding="UTF-8"?>
<project name="Composer Targets" default="build">
<property name="builddir" value="${basedir}/build"/>
<property name="composer" value="${builddir}/composer.phar"/>
<target name="php-check">
<condition property="php" value="php">
<not>
<isset property="${php}"/>
# Redirection of port 80 to port 443
<virtualhost *:80>
ServerName redmine.domain.com
KeepAlive Off
RewriteEngine On
#RewriteCond %{HTTP_HOST} ^[^\./]+\.[^\./]+$
RewriteRule ^/(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
@mwchambers
mwchambers / matrix.py
Created October 26, 2011 14:55
Wake up neo.. the matrix
#/usr/bin/python
import time
import sys
import os
lines=[
"Wake up Neo ...",
"The matrix has you",
"Follow the white rabbit ...",