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
Private Sub cmdKirimGET_Click() | |
Dim strResult As String | |
Dim objHTTP As Object | |
Dim URL As String | |
Set objHTTP = CreateObject("WinHttp.WinHttpRequest.5.1") | |
URL = "http://localhost/search.php" | |
objHTTP.Open "GET", URL, False | |
objHTTP.setRequestHeader "User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" | |
objHTTP.setRequestHeader "Content-type", "application/x-www-form-urlencoded" | |
objHTTP.send ("keyword=php") |
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 | |
// taken from: https://github.com/izniburak/google-bot-curl/blob/master/google-bot.php | |
function googleBot($url) | |
{ | |
$header = array(); | |
$header[] = 'Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5'; | |
$header[] = 'Cache-Control: max-age=0'; | |
$header[] = 'Content-Type: text/html; charset=utf-8'; | |
$header[] = 'Transfer-Encoding: chunked'; |
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
mysql -u root -p | |
SET FOREIGN_KEY_CHECKS=0; | |
use database_name; | |
SOURCE data.sql; | |
SET FOREIGN_KEY_CHECKS=1; | |
exit; |
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
innodb_buffer_pool_size = 4G | |
innodb_log_buffer_size = 256M | |
innodb_log_file_size = 1G | |
innodb_write_io_threads = 16 | |
innodb_flush_log_at_trx_commit = 0 |
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 cv2 | |
image = cv2.imread("image.png") | |
x = cv2.selectROI("Select area", image, fromCenter=False) | |
print("Selected box: ", format(x)) |
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
from PIL import Image | |
from pytesseract import pytesseract | |
path_to_tesseract = r'C:\Program Files\Tesseract-OCR\tesseract.exe' | |
pytesseract.tesseract_cmd = path_to_tesseract | |
img = Image.open("original_image.png") | |
# img.show() | |
box = (297, 10, 584, 50) |
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
' Add reference to: | |
' 1. Microsoft Scripting Runtime | |
' 2. Microsoft Shell Controls and Automation | |
' From Tools > Reference | |
Option Explicit | |
Option Base 0 | |
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMiliseconds As Long) |
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
/* | |
sample usage: | |
var path = getDomPath(element); | |
console.log(path.join(' > ')); | |
output: | |
body > section:eq(0) > div:eq(3) > section#content > section#firehose > div#firehoselist > article#firehose-46813651 > header > h2 > span#title-46813651 | |
taken from: | |
http://stackoverflow.com/questions/5728558/get-the-dom-path-of-the-clicked-a |
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
// no changes to express-part1 | |
npm init | |
npm install --save express | |
npm install --save pug | |
npm install --save-dev nodemon | |
> vi package.json | |
--------------------- | |
package.json [before] |
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 | |
/** | |
* Source: https://stackoverflow.com/questions/2040560/finding-the-number-of-days-between-two-dates | |
* Saksham Gupta | |
*/ | |
function getNumDays($dateStart, $dateEnd) { | |
$vDateStart = new DateTime($dateStart); | |
$vDateEnd = new DateTime($dateEnd); | |
$diff = $vDateEnd->diff($vDateStart)->format("%a"); |
NewerOlder