Skip to content

Instantly share code, notes, and snippets.

View byeblogs's full-sized avatar

Iam ByeBlog`s byeblogs

View GitHub Profile
#/bin/zsh
brew install privoxy
echo -n "<- Enter your http/https PORT ->"
read PORT
echo "PORT = $PORT"
echo "function proxy_off(){" >> ~/.bash_profile
echo " unset http_proxy" >> ~/.bash_profile
echo " unset https_proxy" >> ~/.bash_profile
echo " echo -e "已关闭代理"" ~/.bash_profile
echo "}\n" >> ~/.bash_profile
@byeblogs
byeblogs / PATH SERVER
Created March 27, 2019 07:06
PATH SERVER
Examples for: https://(www.)example.com/subFolder/myfile.php?var=blabla#555
// ======= PATHINFO ====== //
$x = pathinfo($url);
$x['dirname'] 🡺 https://example.com/subFolder
$x['basename'] 🡺 myfile.php?
$x['extension'] 🡺 php?k=blaa#12345 // Unsecure! also, read my notice about hashtag parts
$x['filename'] 🡺 myfile
// ======= PARSE_URL ====== //
@byeblogs
byeblogs / MongoDB Notes
Created January 4, 2019 08:42
How To Use Mongo DB
---------------------------------
# installation
download mongodb
https://www.mongodb.com/download-center
select
"Community server" tab
> "Windows
> download
@byeblogs
byeblogs / ffmpeg screen recorder audio + video
Last active May 25, 2021 11:37
Ffmpeg Screen Recorder
I've done. Get an impressive result for what is free.
So I think it'd be useful to share with people here.
Please note that I'm no expert in ffmpeg. I just looking at the link Marco gave me then do a bit more explore.
Install ffmpeg, in my case, Mac OS X, I install via brew
# brew install ffmpeg
Looking for my device id, audio, video
In my case, there were [1] and [1] and it is depend on your setting.
@byeblogs
byeblogs / using_external_libraries_in_reactjs.txt
Created December 9, 2018 12:09
Example how to using external libraries in react js..
Try following steps:
including the external js file link in your /public/index.html
use the external library with prefix window.
for example, JQuery.
put following line in your /public/index.html
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
use it in your project:
window.$("#btn1").click(function(){
@byeblogs
byeblogs / data_news.json
Last active May 25, 2021 11:38
Data Newsapi
{
"result": [
{
"portal_name": "ABC News",
"portal_init": "abc-news",
"portal_image": "https://s.abcnews.com/assets/images/apple-touch-icons/touch-icon-ipad-retina.png"
},
{
"portal_name": "CNN",
"portal_init": "cnn",
@byeblogs
byeblogs / Setting-MySql-Docker.txt
Last active September 18, 2018 04:15
The server requested authentication method unknown to the client..
you can check by "docker inspect name_of_mysql_1" and then you can use IP of Gateway which is "172.18.0.1"
"NetworkID": "05f4c08c374b61334709dc8ce4b5e5cad8b94e09c27b66b0ed64c89c8d585f1f",
"EndpointID": "4830e8ae5f13cc983252374e1955f8731490e561603996e6c8265ccf79dea73b",
"Gateway": "172.18.0.1",
"IPAddress": "172.18.0.3",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": "02:42:ac:12:00:03",
@byeblogs
byeblogs / diff_range_of_hours.js
Created August 31, 2018 11:00
Check diff range of hours, minutes, second in Javascript..
var startTime = moment('12:00:01', 'hh:mm:ss a');
var endTime = moment('13:00:10' , 'hh:mm:ss a');
var totalHours = (endTime.diff(startTime, 'hours'));
var totalMinutes = endTime.diff(startTime, 'minutes');
var clearMinutes = totalMinutes % 60;
console.log(totalHours + " hours and " + clearMinutes + " minutes");
@byeblogs
byeblogs / data-countries.json
Last active August 28, 2018 11:15
Just example of json of Countries..
[
{ "name" : "Afghanistan", "code" : "AF"},
{ "name" : "Åland Islands", "code" : "AX"},
{ "name" : "Albania", "code" : "AL"},
{ "name" : "Algeria", "code" : "DZ"},
{ "name" : "American Samoa", "code" : "AS"},
{ "name" : "AndorrA", "code" : "AD"},
{ "name" : "Angola", "code" : "AO"},
{ "name" : "Anguilla", "code" : "AI"},
{ "name" : "Antarctica", "code" : "AQ"},