Skip to content

Instantly share code, notes, and snippets.

View codemedic's full-sized avatar
🙂
🙃

Dino Korah codemedic

🙂
🙃
View GitHub Profile
@codemedic
codemedic / fix.diff
Created July 18, 2013 22:36 — forked from kemo/fix.diff
diff --git a/system/core/Kohana.php b/system/core/Kohana.php
index 271f917..287c271 100644
--- a/system/core/Kohana.php
+++ b/system/core/Kohana.php
@@ -722,7 +722,7 @@ final class Kohana {
if (ob_get_level() >= self::$buffer_level)
{
// Set the close function
- $close = ($flush === TRUE) ? 'ob_end_flush' : 'ob_end_clean';
+ $close = ($flush === TRUE) ? 'ob_end_flush' : 'Kohana::_ob_end_clean';
@codemedic
codemedic / RESTdoc
Last active June 9, 2020 08:24 — forked from coderofsalvation/RESTdoc
bash utility to generate REST-documentation from sourcecode comments
#!/bin/bash
#
# A quickndirty bash-utility to generate REST-documentation from sourcecode comments.
# (initially aimed at php-files, but js should also work)
# Basically its a c-style comment -> markdown -> html converter
# Dependancies:
# - awk
# - sed
# - bash
# - php
// Copyright (c) 2012 Bryce Adelstein-Lelbach
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// hpx::util::container_device can be found here:
// http://raw.github.com/STEllAR-GROUP/hpx/master/hpx/util/container_device.hpp
// The portable binary archives used can be found here:
// http://raw.github.com/STEllAR-GROUP/hpx/master/hpx/util/portable_binary_oarchive.hpp
#ifndef ASIO_RANGE_UTIL_HPP_
#define ASIO_RANGE_UTIL_HPP_
#include <boost/range/iterator_range.hpp>
#include <boost/range/algorithm/search.hpp>
#include <boost/asio/buffer.hpp>
namespace httpc {
template <typename T>
inline boost::iterator_range<T *> make_iterator_range_from_memory(T *head, size_t size) {
<?php
// Crude check. Off course this should be stored in a (memory) database. $token is an
// access token that is provided by oauth.
$token = $_SERVER['HTTP_X_AUTH_TOKEN'];
if ($token == "mellon") {
header("X-Api-User: Gandalf");
header("X-Api-Context: Middle-Earth");
header("Cache-Control: public, max-age=120");
<?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)
@codemedic
codemedic / .fonts.conf
Last active August 29, 2015 14:08 — forked from odony/.fonts.conf
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!--
Documented at
http://linux.die.net/man/5/fonts-conf
To check font mapping run the command at terminal
$ fc-match 'helvetica Neue'
@codemedic
codemedic / jquery.stoc.js
Last active August 29, 2015 14:27 — forked from goldsky/jquery.stoc.js
jQuery Plugin: Table of Contents with Smooth Scrolling
/**
* jQuery Plugin: Table of Contents with Smooth Scrolling
* @link http://www.1stwebdesigner.com/css/jquery-plugin-smooth-scrolling/
* @author Rochester Oliveira
*/
(function($){
$.fn.stoc = function(options) {
//Our default options
var defaults = {
@codemedic
codemedic / VirtualBoxKickstart.md
Created December 7, 2015 16:01 — forked from jtyr/VirtualBoxKickstart.md
How to use kickstart in VirtualBox

How to use kickstart in VirtualBox

This short howto describes how to install VMs via kickstart in VirtualBox. It's using PXE functionality built into the NAT network mode of the VirtualBox. The following instructions apply to CentOS installation but it should work for any RedHat-based distro.

Prepare directory structure

@codemedic
codemedic / check_docker_container.sh
Created January 5, 2016 18:45 — forked from ekristen/check_docker_container.sh
Bash Script for Nagios to Check Status of Docker Container
#!/bin/bash
# Author: Erik Kristensen
# Email: erik@erikkristensen.com
# License: MIT
# Nagios Usage: check_nrpe!check_docker_container!_container_id_
# Usage: ./check_docker_container.sh _container_id_
#
# The script checks if a container is running.
# OK - running