Skip to content

Instantly share code, notes, and snippets.

Currently a late nighter

Austin Nicomedez 02Tea

Currently a late nighter
View GitHub Profile
02Tea /
Created May 18, 2020
[rsync remote to local vice versa] #rsync #bash #migrate
# Local to Remote: rsync [OPTION]... -e ssh [SRC]... [USER@]HOST:DEST
# Remote to Local: rsync [OPTION]... -e ssh [USER@]HOST:SRC... [DEST]
# remote -> local
rsync -havz -e ssh user@ /var/www/localsite/
# local -> remote
rsync -havz -e ssh /var/www/localsite/ user@
# dry run
02Tea /
Created Apr 2, 2020
[Multifile search from root folder using grep] #grep #bash #shell
grep -R 'class="close-btn"' .
# limiting searches to files with a specific extension
grep '.ad' **/*.css
# grepping inside vim
:grep -F '.ad' **/*.css
02Tea /
Created Mar 29, 2020
[Greet differently on the time of day] #bash #bashrc #zsh #zshrc #sh #date #til
h=`date +%H`
if [ $h -lt 12 ]; then
echo '
▄████ ▒█████ ▒█████ ▓█████▄
██▒ ▀█▒▒██▒ ██▒▒██▒ ██▒▒██▀ ██▌
▒██░▄▄▄░▒██░ ██▒▒██░ ██▒░██ █▌
░▓█ ██▓▒██ ██░▒██ ██░░▓█▄ ▌
02Tea / media_queries_break_points.scss
Created Mar 26, 2020
[Media Queries Break Points] #css #scss #css_mediaqueries #css_breakpoints #rwd
View media_queries_break_points.scss
// ============================================
// Media Break Points
// Usage: @media #{$small-screen} { code here }
// ============================================
$smaller-only-screen: "only screen and (max-width : 20em)";
$small-only-screen: "only screen and (max-width : 45em)";
$small-screen: "only screen and (min-width : 30em)";
$medium-screen: "only screen and (min-width : 45em)";
$large-screen: "only screen and (min-width : 60em)";
02Tea /
Created Jun 6, 2019
[Search Replace DB CLI] #srdb #database #cli #mysql #mariadb

Dry run

php srdb.cli.php -h <> -n <database_name> -u <database_user> -p <database_password> --port <database_port> -s <search_string> -r <replace_query> -z


php srdb.cli.php -h <> -n <database_name> -u <database_user> -p <database_password> --port <database_port> -s <search_string> -r <replace_query>
02Tea / watermelonBMTest.js
Last active Apr 2, 2018
[Watermelon BM test] #javascript
View watermelonBMTest.js
javascript:(function(){"use strict";function _toConsumableArray(e){if(Array.isArray(e)){for(var t=0,o=Array(e.length);t<e.length;t++)o[t]=e[t];return o}return Array.from(e)}function Watermelon(e){var t=[],o=void 0,r=void 0,n={colors:5,threshold:255},a=e?e:n,l={position:"absolute",width:"100%",height:"100%","z-index":99999},i={display:"inline-block",position:"relative","margin-bottom":"-5px",height:"100%",width:a.size+"%",transition:"all 0.3s ease"},c=function(e){return console.log(e)},d=function(){var e=50+Math.floor(Math.random()*a.threshold),t=50+Math.floor(Math.random()*a.threshold),o=50+Math.floor(Math.random()*a.threshold);return"rgb( "+e+", "+t+", "+o+" )"},s=function(e){var t="";for(var o in e)e.hasOwnProperty(o)&&(t+=o+":"+e[o]+";");return t},u=function(e,t,o){var r=o|t<<8|e<<16;return"#"+(16777216+r).toString(16).slice(1)},m=function(e){return e.substring(4,e.length-1).replace(/ /g,"").split(",")},p=function(){document.getElementById("exocarp")&&document.getElementById("exocarp").remove();var e=docum
02Tea /
Last active Mar 11, 2018
[rdesktop] remote desktop tool #tools #linux #windows

90% of actual screen size

rdesktop -u <username> -g 90% <ipaddress>


rdesktop -z -P -f -u <username> <ipaddress>

folder sharing

02Tea /
Created Jan 15, 2018
[watch-http-server] livereload your projects locally #npm #tools
02Tea /
Last active Dec 6, 2017
[Laravel Permission Issue] resolve permission issue #laravel #php
# root
php artisan cache:clear
php -i | grep USER
chown -R www-data:www-data storage
02Tea / js-dynamic-image-sizes.js
Created Jul 25, 2017
[Dynamic image sizes] #js #jquery
View js-dynamic-image-sizes.js
$('.events__deck > img').each(function(){
$(this).on('load', function(){
var w = $(this).prop("naturalWidth");
var h = $(this).prop("naturalHeight");
var ex = 0.10;
// expand images
w += w * ex;
h += h * ex;
You can’t perform that action at this time.