Category Archives: Uncategorized

How to Send (POST) JSON Data with PHP cURL

Example PHP code to send (via HTTP POST) JSON data to an URL: $data = array( "username" => "admin", "password" => "password", );   $curl = curl_init("https://api.website.com/v1/auth/login/"); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLINFO_HEADER_OUT, 1); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data)); curl_setopt($curl, CURLOPT_HTTPHEADER, array(‘Content-Type: application/json’); $output = curl_exec($curl); curl_close($curl);   print_r(json_decode($output));$data = array( "username" => "admin", "password" […]

PCRE Fnmatch() PHP Function for Wildcard String Match

PHP function fnmatch() has 4096 characters limit: Warning: fnmatch(): Filename exceeds the maximum allowed length of 4096 charactersWarning: fnmatch(): Filename exceeds the maximum allowed length of 4096 characters To avoid these limits we can use a PCRE-like fnmatch() function: https://www.php.net/manual/en/function.fnmatch.php#100207 Here is a modified PHP code found in the php.net website: if (!function_exists(‘fnmatch’)) { define(‘FNM_PATHNAME’, […]

Delphi XE Add Icons and Images as Resources

First Click on Project -> Resources and Images: Then just click on “Add” to add an icon or image: For icons, make sure to use all UPPERCASE characters. Here is an example to use a icon resource in the trayicon: procedure TForm1.Button4Click(Sender: TObject); begin TrayIcon1.Visible := False; TrayIcon1.Icon.LoadFromResourceName(hInstance, ‘ICON1’); TrayIcon1.Visible := True; end;procedure TForm1.Button4Click(Sender: TObject); […]

Delphi XE Change System Tray Icon with TTrayIcon (No Blurry)

You can change system tray icon by using TTrayIcon and TImageList: procedure TForm1.Button4Click(Sender: TObject); begin TrayIcon1.IconIndex := 0; end;   procedure TForm1.Button5Click(Sender: TObject); begin TrayIcon1.IconIndex := 1; end;procedure TForm1.Button4Click(Sender: TObject); begin TrayIcon1.IconIndex := 0; end; procedure TForm1.Button5Click(Sender: TObject); begin TrayIcon1.IconIndex := 1; end; However this seems to add a blurry effect on the icon (not […]

Install Latest NVIDIA Drivers for Windows 10

Open this URL in your browser: https://www.nvidia.com/Download/index.aspx?lang=en-us Enter your NVIDIA graphic card details and click the Search button. BONUS TIP: If you are a creative or business and not a gamer, select: Download Type = Studio Driver (SD) These drivers focuses on stability and wuality.

Download Old Sent Emails on POP Account with Thunderbird

POP mail accounts can only access and download inbox messages. However you can use a smart workaround to download also old sent messages, in short what you can do is create a new IMAP mail account, download the sent emails there, then select all sent emails, copy them to the POP mail account’s sent folder, […]

Artillery Sidewinder X1 3D Printer

I was looking for a good 3D printer in terms of quality and price and I found this Artillery Sidewinder X1 3D Printer. Looks like to be new (year 2020) and very popular among 3D printer geeks, so here is an image of the printer: You will need also these items: Creality 3D® PLA Filament […]

Share Buttons for Facebook, Twitter and LinkedIn

I was looking for PNG images of Facebook, Twitter and LinkedIn share buttons to use with A HREF links (I didn’t want to use Javascript or third-parties code). Here you can find PNG images for Facebook, Twitter, LinkedIn share buttons. To download them just right-click on the image and select “Save Image As…” Feel free […]

User-Agent Strings of Perl, Wget, cURL, Python, Java

User-agent strings of Perl, Wget, cURL, Python, Java: Apache-HttpClient/4.5.9 (Java/1.8.0_222) Wget/1.15 (linux-gnu) Python-urllib/2.7 curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.44 zlib/1.2.3 libidn/1.18 libssh2/1.4.2 libwww-perl/5.76Apache-HttpClient/4.5.9 (Java/1.8.0_222) Wget/1.15 (linux-gnu) Python-urllib/2.7 curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.44 zlib/1.2.3 libidn/1.18 libssh2/1.4.2 libwww-perl/5.76

3 Cards in a Row with Bootstrap 4.4

Example of 3 cards in a row with Bootstrap 4.4: <div class="row py-3"> <div class="col-sm-4 py-3"> <div class="card"> <div class="card-body"> <h5 class="card-title">Example Title 1</h5> <p class="card-text">With supporting text below as a natural lead-in to additional content.</p> <a href="#" class="btn btn-primary">Go somewhere</a> </div> </div> </div> <div class="col-sm-4 py-3"> <div class="card"> <div class="card-body"> <h5 class="card-title">Example Title 2</h5> […]