Skip to content

Instantly share code, notes, and snippets.

💭
Having Fun

Tony Brix UziTech

💭
Having Fun
Block or report user

Report or block UziTech

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View blockstack.txt
Verifying my Blockstack ID is secured with the address 1H8NMosfNwzvXzUuUtroXbp5vHaWNZBqLZ https://explorer.blockstack.org/address/1H8NMosfNwzvXzUuUtroXbp5vHaWNZBqLZ
View keybase.md

Keybase proof

I hereby claim:

  • I am uzitech on github.
  • I am tonybrix (https://keybase.io/tonybrix) on keybase.
  • I have a public key ASDne4lL1j7wiU5Lin8T5awJmGfQumiXmJnNv7ALdvqZKwo

To claim this, I am signing this object:

@UziTech
UziTech / rimraf.js
Created Dec 9, 2016
Remove a file or directory recursively
View rimraf.js
const fs = require("fs");
const path = require("path");
function rimraf(dir) {
return new Promise(function (resolve, reject) {
fs.lstat(dir, function (err, stats) {
if (err) return reject(err);
if (stats.isDirectory()) {
fs.readdir(dir, function (err, files) {
if (err) return reject(err);
@UziTech
UziTech / csv_to_array.php
Last active Jul 8, 2016
Convert a csv file to an array
View csv_to_array.php
/**
* Convert a comma separated file into an array.
*
* @param string $filename Path to the CSV file
* @param string[]|bool $header An array used for the keys for an associative array. If set to TRUE then the first row of the file is used as the header. If set to FALSE then a numbered array is used instead.
* @param string $delimiter The separator used in the file
* @return string[][]
* @link http://gist.github.com/385876
* @author Jay Williams <http://myd3.com/>
* @copyright Copyright (c) 2010, Jay Williams
View array_multisort_by_key.php
/*
* License: MIT
*/
/**
* Sort an array of associative arrays by a key. Like array_multisort but you just provide the key instead of the whole column.
* @param array[] $data The array of associative arrays to sort
* @param mixed ...$args Any number of variables. [key, SORT_ASC|SORT_DESC, Sort Flags]
* https://secure.php.net/manual/en/function.array-multisort.php
* @return array[] The sorted $data
@UziTech
UziTech / searchDirectory.php
Last active Jun 17, 2016
Search files in php, recursive, regex
View searchDirectory.php
/*
* License: MIT
*/
/**
* Search files in a directory by string or regex
* @param string $root Directory to search
* @param string $q Search term
* @param bool $recursive [optional] Search lower directories. Default = TRUE
* @param bool $isRegex [optional] Search term is a regular expression. Default = FASLE
@UziTech
UziTech / glob_recursive.php
Created Jun 16, 2016
Recursive glob search in php
View glob_recursive.php
/*
* License: DWTFYW
*/
function glob_recursive($base, $pattern, $flags = 0) {
if (substr($base, -1) !== DIRECTORY_SEPARATOR) {
$base .= DIRECTORY_SEPARATOR;
}
$files = glob($base.$pattern, $flags);
@UziTech
UziTech / fs-readdir-recursive.js
Created May 20, 2016
node get files from directory asynchronously and recursively with promises
View fs-readdir-recursive.js
/*
* License: MIT
* Author: Tony Brix, https://Tony.Brix.ninja
* Description: Get files from directory asynchronously and recursively with promises.
*/
var fs = require("fs");
var path = require("path");
module.exports = {
@UziTech
UziTech / array.remove.js
Last active Oct 17, 2015
Remove items from an array. Optionally limit the number of items to remove from the beginning or end of the array.
View array.remove.js
/**
* Author: Tony Brix
* Website: tony.brix.ninja
* License: MIT
* Description: Remove items from an array. Optionally limit the number of items to remove from the beginning or end of the array.
* Examples:
* var a = [1, 2, 3, 1, 2, 3];
* a.remove(1); // [2, 3, 2, 3]
* a.remove(2, 1); // [1, 3, 1, 2, 3]
* a.remove(3, -1); // [1, 2, 3, 1, 2]
@UziTech
UziTech / jquery.pluginTemplate.js
Last active Oct 6, 2015
jQuery Plugin Template
View jquery.pluginTemplate.js
/**
* Author: Tony Brix, Tony@Brix.ninja
* License: MIT http://www.opensource.org/licenses/mit-license.php
* Template Gist: https://gist.github.com/UziTech/f85d7756ed931c304281
* Description:
*/
;
(function ($, undefined) {
"use strict";
var pluginName = "plugintemplate";//TODO: ENTER YOUR PLUGIN NAME
You can’t perform that action at this time.