Skip to content

Instantly share code, notes, and snippets.

View butuzov's full-sized avatar
🇺🇦

Oleg Butuzov butuzov

🇺🇦
View GitHub Profile

Java Exception Example UnexceptableInputException.java

class UnexceptableInputException extends Exception{
	public UnexceptableInputException() {}

	public UnexceptableInputException(String message){
		super(message);
	}
}
@butuzov
butuzov / Installing Google Test on Mac.md
Last active April 4, 2024 10:08
Bash Script to install Google Test and Google Mock on Mac

Installing Google Test on Mac

One bash script to install google test (and mock) on your Mac. I assume you already had install cmake (if not, use brew - brew install cmake).

It use brew directories to store gmock and gtest.

gtest_installer.sh

#!/usr/bin/env bash
@butuzov
butuzov / wp-query-ref.php
Created September 11, 2016 11:28 — forked from luetkemj/wp-query-ref.php
WP: Query $args
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/query.php
*/
$args = array(
@butuzov
butuzov / setup-dev.sh
Created October 4, 2015 09:37
Install homebrew, nginx, mysql, php55, and composer on Mac OS X
#!/bin/bash
# install homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# install homebrew's official php tap
brew tap josegonzalez/homebrew-php
@butuzov
butuzov / uri.js
Created August 27, 2015 07:54
URI Parsing with Javascript (alternative)
function parse_url(url) {
/* Dom parsing of A
based at https://gist.github.com/jlong/2428561
*/
var parser = document.createElement('a');
parser.href = url;
/* Exception for user:password */
var re = /(\/\/)(.+?)((:(.+?))?)@/i;
if ( re.exec(url) ){