Skip to content

Instantly share code, notes, and snippets.

Avatar
👻
Currently a late nighter

Austin Nicomedez 02Tea

👻
Currently a late nighter
View GitHub Profile
@02Tea
02Tea / rsync_remote_to_local_vice_versa.sh
Created May 18, 2020
[rsync remote to local vice versa] #rsync #bash #migrate
View rsync_remote_to_local_vice_versa.sh
# 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@12.12.12.12:/var/wwww/livesite/ /var/www/localsite/
# local -> remote
rsync -havz -e ssh /var/www/localsite/ user@12.12.12.12:/var/www/livesite/
# dry run
@02Tea
02Tea / multifile_search_from_root_folder_using_grep.sh
Created Apr 2, 2020
[Multifile search from root folder using grep] #grep #bash #shell
View multifile_search_from_root_folder_using_grep.sh
grep -R 'class="close-btn"' .
# limiting searches to files with a specific extension
grep '.ad' **/*.css
# grepping inside vim
:grep -F '.ad' **/*.css
@02Tea
02Tea / greet_differently_on_the_time_of_day.sh
Created Mar 29, 2020
[Greet differently on the time of day] #bash #bashrc #zsh #zshrc #sh #date #til
View greet_differently_on_the_time_of_day.sh
# http://patorjk.com/software/taag/#p=display&f=Bloody&t=Good%0AEvening
h=`date +%H`
if [ $h -lt 12 ]; then
echo '
▄████ ▒█████ ▒█████ ▓█████▄
██▒ ▀█▒▒██▒ ██▒▒██▒ ██▒▒██▀ ██▌
▒██░▄▄▄░▒██░ ██▒▒██░ ██▒░██ █▌
░▓█ ██▓▒██ ██░▒██ ██░░▓█▄ ▌
@02Tea
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
02Tea / search_replace_db_cli.md
Created Jun 6, 2019
[Search Replace DB CLI] #srdb #database #cli #mysql #mariadb
View search_replace_db_cli.md

Dry run

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

Run

php srdb.cli.php -h <172.21.0.4> -n <database_name> -u <database_user> -p <database_password> --port <database_port> -s <search_string> -r <replace_query>
@02Tea
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
02Tea / rdesktop.md
Last active Mar 11, 2018
[rdesktop] remote desktop tool #tools #linux #windows
View rdesktop.md

90% of actual screen size

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

fullscreen

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

folder sharing

@02Tea
02Tea / watch-http-server.md
Created Jan 15, 2018
[watch-http-server] livereload your projects locally #npm #tools
View watch-http-server.md
@02Tea
02Tea / laravel-permission.md
Last active Dec 6, 2017
[Laravel Permission Issue] resolve permission issue #laravel #php
View laravel-permission.md
# root
php artisan cache:clear
php -i | grep USER
chown -R www-data:www-data storage
@02Tea
02Tea / js-dynamic-image-sizes.js
Created Jul 25, 2017
[Dynamic image sizes] #js #jquery
View js-dynamic-image-sizes.js
$(document).ready(function(){
$('.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.