Skip to content

Instantly share code, notes, and snippets.

@pkvip9999
pkvip9999 / google_login.ts
Created February 16, 2022 14:13 — forked from Brandawg93/google_login.ts
Login to Google Account via Puppeteer
import puppeteer from 'puppeteer-extra';
import pluginStealth from 'puppeteer-extra-plugin-stealth'; // Use v2.4.5 instead of latest
import * as readline from 'readline';
puppeteer.use(pluginStealth());
// Use '-h' arg for headful login.
const headless = !process.argv.includes('-h');
// Prompt user for email and password.
@pkvip9999
pkvip9999 / AdbCommands
Created February 10, 2022 16:32 — forked from Pulimet/AdbCommands
Adb useful commands list
adb help // List all comands
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
@pkvip9999
pkvip9999 / Common-Currency.json
Created September 19, 2021 04:26 — forked from ksafranski/Common-Currency.json
Common Currency Codes in JSON
{
"USD": {
"symbol": "$",
"name": "US Dollar",
"symbol_native": "$",
"decimal_digits": 2,
"rounding": 0,
"code": "USD",
"name_plural": "US dollars"
},
@pkvip9999
pkvip9999 / pdftitle.py
Last active June 1, 2021 04:56 — forked from vuthaihoc/pdftitle.py
Rename pdf files to their content's titles (for Python 3; with wildcard support; default rename all pdfs)
#!/usr/bin/env python
"""
Extracts title from PDF files (Python 3).
Depends on: pdf, pyPDF2, PDFMiner3k, unidecode.
Usage:
pdftitle -d tmp --rename *.pdf{}
"""
from io import StringIO
@pkvip9999
pkvip9999 / tfpdf.py
Created May 21, 2021 03:52 — forked from bllchmbrs/tfpdf.py
TF IDF Explained in Python Along with Scikit-Learn Implementation
from __future__ import division
import string
import math
tokenize = lambda doc: doc.lower().split(" ")
document_0 = "China has a strong economy that is growing at a rapid pace. However politically it differs greatly from the US Economy."
document_1 = "At last, China seems serious about confronting an endemic problem: domestic violence and corruption."
document_2 = "Japan's prime minister, Shinzo Abe, is working towards healing the economic turmoil in his own country for his view on the future of his people."
document_3 = "Vladimir Putin is working hard to fix the economy in Russia as the Ruble has tumbled."
@pkvip9999
pkvip9999 / gist:c097f539316f27d32c0565aeeb1f37b5
Created May 14, 2021 10:23 — forked from Diftraku/gist:5888214
A "simple" PHP function to convert arrays into DataTable JSON export format fit to use with Google Charts
<?php
/**
* arrayToDataTable()
* Converts PHP arrays to nested arrays fit for json_encode()
*
* Format Notice:
* - $cols contains all the columns for the DataTable, each column having a type and a label.
* Columns can be defined as plain arrays (containing only type and label, see below) or as a named array,
* with each of the properties defined as key => value pairs. All columns must have at least a 'type'.
*
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
@pkvip9999
pkvip9999 / indexed.php
Created March 31, 2021 04:49 — forked from qsun/indexed.php
Check if URL is indexed by Google
<?php
function indexed($url) {
$url = 'http://webcache.googleusercontent.com/search?q=cache:' . urlencode($url);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
curl_setopt($ch, CURLOPT_NOBODY, true);
curl_setopt($ch, CURLOPT_USERAGENT, 'Chrome 10');
@pkvip9999
pkvip9999 / system_usage_log.sh
Created June 17, 2020 07:07 — forked from vuthaihoc/system_usage_log.sh
System usage bash
#!/bin/bash
## Use : ss command
## variable for change :
##
##----------
Timetemp='%H%M'
Time=$(date +"${Timetemp}")
Date=$(date +"%y%m%d")
Yest=$(date --date="1 day ago" +"%y%m%d")
#Day=$(date +"%a")
@pkvip9999
pkvip9999 / create_mysql5_db.sh
Created June 17, 2020 07:07 — forked from vuthaihoc/create_mysql5_db.sh
Script create db, user and grant permission
#!/bin/bash
# sudo ./mysql-db-create.sh dbname dbuser password
# Functions
ok() { echo -e '\e[32m'$1'\e[m'; } # Green
EXPECTED_ARGS=3
E_BADARGS=65
MYSQL=`which mysql`