Skip to content

Instantly share code, notes, and snippets.

View heyitsnovi's full-sized avatar
🎯
Focusing

Кел-Нови heyitsnovi

🎯
Focusing
View GitHub Profile
@heyitsnovi
heyitsnovi / encrypt-decrypt.php
Created July 15, 2018 08:44
Encrypt Decrypt using PHP (Openssl)
<?php
//replace it with your own key
$key = 'TVpI8MlRPQcUH0mOyrKKrJgnIcVM9kXb8Ke6XZkJXW7WyHYbUDMYdNMWgq9e';
$encrypted_str = encrypt_string('John Doe is Here');
$decrypted_str = decrypt_string($encrypted_str);
@heyitsnovi
heyitsnovi / database.php
Created December 18, 2019 01:33
CodeIgniter MSSQL connection settings
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
$active_group = 'default';
$query_builder = TRUE;
$db['default'] = array(
'dsn' => '',
'hostname' => 'Driver={SQL Server};Server=DESKTOP-123456;Database=database_name',
@heyitsnovi
heyitsnovi / binary_search_recursive.js
Created January 10, 2020 06:41
Recursion is a way where we repeatedly call the same function until a base condition is matched to end the recursion. Proceeding with the steps in method 1 here we use the same idea by just changing the parameters of the function in recursive manner and breaking down the problem.
function binarySearch(arr = [], b_start, b_end, x){
if (b_end < b_start)
return false;
var mid = Math.floor((b_end + b_start)/2);
<?php
$ALGORITHM = 'AES-128-CBC';
$IV = '12dasdq3g5b2434b';
$error = '';
if (isset($_POST) && isset($_POST['action'])) {
$password = isset($_POST['password']) && $_POST['password']!='' ? $_POST['password'] : null;
@heyitsnovi
heyitsnovi / Subtractime.php
Created May 18, 2020 04:55
Example of subtracting 2 times
<?php
$hourly_rate = 2.5;
$startTime = new DateTime("2020-05-14 08:00:00");
$endTime = new DateTime("2020-05-14 17:00:00");
$duration = $startTime->diff($endTime); //$duration is a DateInterval object
$worked_hours = (int)$duration->format("%H");
echo $worked_hours * 2.5;
@heyitsnovi
heyitsnovi / export.txt
Created June 16, 2020 08:34
Export Sqlite Non Debuggable Android App
1 adb backup -noapk com.developername.appname
2 dd if=backup.ab bs=24 skip=1|openssl zlib -d > backup.tar;
3 tar -xvf backup.tar
https://medium.com/@k1d_bl4ck/how-to-extract-the-database-and-other-things-from-an-enterprise-android-app-2194a52b249b
<?php
date_default_timezone_set('Asia/Manila');
function isBetween($from, $till, $input) {
$fromTime = strtotime($from);
$toTime = strtotime($till);
$inputTime = strtotime($input);
return($inputTime >= $fromTime and $inputTime <= $toTime);
}
<?php
/*
💬 Get Google-Reviews with PHP cURL & without API Key
=====================================================
**This is a dirty but usefull way to grab the first 8 most relevant reviews from Google with cURL and without the use of an API Key**
How to find the needed CID No:
- use: [https://pleper.com/index.php?do=tools&sdo=cid_converter]
[
{
"brgy":"Agsoso",
"Lat":"9.7897",
"Lon":"123.8203"
},
{
"brgy":"Badbad Occidental",
"Lat":"9.8030",
"Lon":"123.8133"
This file has been truncated, but you can view the full file.
{
"rows": [
{
"type": 3,
"data": {
"source": 3,
"id": 1,
"x": 0,
"y": 733
},