Skip to content

Instantly share code, notes, and snippets.

View Sama34's full-sized avatar
👽
I may be slow to respond due to language differences.

Omar G. Sama34

👽
I may be slow to respond due to language differences.
View GitHub Profile
@Sama34
Sama34 / gist:10012654
Last active August 29, 2015 13:58
OUGC Get Preview Function
<?php
/***************************************************************************
*
* OUGC Get Preview Function
* Author: Omar Gonzalez
* Copyright: © 2012-2014 Omar Gonzalez
*
* Website: http://omarg.me
*
@Sama34
Sama34 / gist:10015046
Created April 7, 2014 04:59
OUGC Count Characters Function
<?php
/***************************************************************************
*
* OUGC Count Characters Function
* Author: Omar Gonzalez
* Copyright: © 2013-2014 Omar Gonzalez
*
* Website: http://omarg.me
*
@Sama34
Sama34 / ougc_hibanamem.php
Created July 22, 2014 07:22
OUGC Hide Users With Bad-words In Usernames From Member List
<?php
/***************************************************************************
*
* OUGC Hide Users With Bad-words In Usernames From Member List plugin (/inc/plugins/ougc_hibanamem.php.php)
* Author: Omar Gonzalez
* Copyright: © 2014 Omar Gonzalez
*
* Website: http://omarg.me
*
<?php
/**
* Convert a comma separated file into an associated array.
* The first row should contain the array keys.
*
* Example:
*
* @param string $filename Path to the CSV file
* @param string $delimiter The separator used in the file
* @return array

Spurred by recent events (https://news.ycombinator.com/item?id=8244700), this is a quick set of jotted-down thoughts about the state of "Semantic" Versioning, and why we should be fighting the good fight against it.

For a long time in the history of software, version numbers indicated the relative progress and change in a given piece of software. A major release (1.x.x) was major, a minor release (x.1.x) was minor, and a patch release was just a small patch. You could evaluate a given piece of software by name + version, and get a feeling for how far away version 2.0.1 was from version 2.8.0.

But Semantic Versioning (henceforth, SemVer), as specified at http://semver.org/, changes this to prioritize a mechanistic understanding of a codebase over a human one. Any "breaking" change to the software must be accompanied with a new major version number. It's alright for robots, but bad for us.

SemVer tries to compress a huge amount of information — the nature of the change, the percentage of users that wil

<?php
# Ref: http://community.mybb.com/thread-157011.html
# Ref: http://risk-rpg.net/groupstats.php
define("IN_MYBB", 1);
require_once "./global.php";
$usergroups = $cache->read('usergroups');
$groups = array('Vampire Groups' => [18, 21, 22],
@Sama34
Sama34 / foo.php
Last active August 29, 2015 14:10
MyBB::Plugin uninstallation confirmation page
<?php
// _uninstall() routine for our plugins
function foo_uninstall()
{
global $mybb;
// Only run if a post request
if($mybb->request_method != 'post')
{
@Sama34
Sama34 / ougc_newthread.php
Created January 28, 2015 02:49
OUGC New Thread plugin
<?php
/***************************************************************************
*
* OUGC New Thread plugin (/inc/plugins/ougc_newthread.php)
* Author: Omar Gonzalez
* Copyright: © 2014 Omar Gonzalez
*
* Website: http://omarg.me
*
@Sama34
Sama34 / disposemail.php
Created February 13, 2015 22:14
MyBB: Disposable Email Blacklist
<?php
if(!defined("IN_MYBB"))
{
die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
}
function disposemail_info()
{
return array(
"name" => "Disposable Email Blacklist",
<?php
/**
* Convert a comma separated file into an associated array.
* The first row should contain the array keys.
*
* Example:
*
* @param string $filename Path to the CSV file
* @param string $delimiter The separator used in the file
* @return array