This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ArrayUtils { | |
/** | |
* - Groups a (non-associative) array of items into associative array of chunks (of items), where key of chunk | |
* is determined by $key_retriever callable | |
* OR | |
* - Groups elements of an array into subarrays, thereby converting Array into Array[group => Array] | |
* | |
* - Check unit-tests to understand further | |
* @param array $data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# reference: https://stackoverflow.com/a/30076212/3679900 | |
git for-each-ref 'refs/remotes/my-origin' --sort=-committerdate refs/heads --format='%(refname:short)%09%(committerdate:relative)%09%(authorname)%09%(subject)%09'|column -ts'|' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Utils; | |
class ImageTextRenderUtils { | |
/** | |
* Returns expected width of rendered text in pixels |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- reference: https://stackoverflow.com/a/9620273/3679900 | |
SELECT TABLE_NAME AS `Table`, | |
round(((data_length) / 1024 / 1024 / 1024), 2) `Size-in-GB` | |
FROM information_schema.TABLES | |
WHERE table_schema = 'my_db_name' | |
AND TABLE_NAME IN ('my_table_1', | |
'my_table_2') | |
ORDER BY (data_length) DESC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this regex will clean output of Hive's SHOW CREATE TABLE .. statement | |
(^\| |\s+\|$| COMMENT 'from deserializer') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Removes invisible characters (like formfeed) | |
# also coerces UTF-8 encoding | |
iconv -c -f utf-8 -t ascii source_filename.csv > destination_filename.csv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hashlib | |
import os | |
import sys | |
# ///////////////////////// | |
# file-read / write methods | |
# ///////////////////////// | |
def get_utf8_file_descriptor(file_path, mode): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
`yarn application --list | awk '{print $1}' | grep application | xargs yarn application -kill` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rsync -avze "ssh -t -p 272 {user_name_on_entry}@entry.organization.farm ssh [email protected]" {home_folder_name} :/home/admin/{dest_folder_name} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
____/ ( ( ) ) \___ | |
/( ( ( ) _ )) ) )\ | |
(( ( )( ) ) ( ) ) | |
((/ ( _( ) ( _) ) ( () ) ) | |
( ( ( (_) (( ( ) .((_ ) . )_ | |
( ( ) ( ( ) ) ) . ) ( ) | |
( ( ( ( ) ( _ ( _) ). ) . ) ) ( ) | |
( ( ( ) ( ) ( )) ) _)( ) ) ) | |
( ( ( \ ) ( (_ ( ) ( ) ) ) ) )) ( ) |
NewerOlder