Skip to content

Instantly share code, notes, and snippets.

View antichris's full-sized avatar
🇺🇦
Russi, cedite illac quo navis bellica ivit

antichris

🇺🇦
Russi, cedite illac quo navis bellica ivit
View GitHub Profile
@antichris
antichris / gologging_test.go
Last active August 23, 2020 16:15 — forked from Avinash-Bhat/gologging_test.go
benchmark for disabling logs with various packages
package main
import (
logging "github.com/op/go-logging"
"io/ioutil"
"log"
"os"
"testing"
)
@antichris
antichris / mb_substr_replace.php
Last active October 4, 2017 19:21
An `mb_substr_replace()` implementation
<?php
/**
* Replace text within a portion of a multi-byte string
* <p>
* Performs a multi-byte safe <i>{@link substr_replace()}</i> operation replacing a copy of <i>string</i> delimited by
* the <i>start</i> and (optionally) <i>length</i> parameters with the string given in <i>replacement</i>.
*
* @see http://php.net/manual/en/function.substr-replace.php
* @see http://php.net/manual/en/function.mb-substr.php
<?php
define('T', ' ');
define('N', PHP_EOL);
$functions = array();
$classes = array();
$constant_prefix = 'X_';
$php = '<?php' . N;
@antichris
antichris / about.md
Created October 21, 2013 14:55
Fork your own Gist

Fork your own Gist

This is a bookmarklet that adds a fully functional Fork button to your own Gist.

If a Fork button is already present in the page, this bookmarklet will set focus to it instead of adding another one.

The change is temporary and the button will disappear as soon as you navigate away from that Gist (clicking the Fork button does this for you as well).