Skip to content

Instantly share code, notes, and snippets.

View puncoz's full-sized avatar
🇳🇵
Working from home

Puncoz Nepal puncoz

🇳🇵
Working from home
View GitHub Profile
<?php
/**
* Class To Web-scrap nepse contents from MeroLagani Sites
*/
class Nepse
{
private $url;
private $curlResponse;
private $domDocument;
<?php
function url_encrypt($string)
{
$encrypt_method = "AES-256-CBC";
$secret_key = 'ZwZSUU50OW2doUTXNHSUNYaGZOWUwQ0c3Z2doUwQ0cNYUU3ZUT09SNHX5wZSUaG9';
$secret_iv = 'Zw0c3Z2d0OW2doUTXNoUwQ0cNYUU3ZUT09SU5HSUUwQUaG9NYaGNHX5wZSZSUZOWZw0c3Z2d5wZSZSUZOWoUwQ0cN0OWYUU3ZUT09SU5HSUUwQUaG2doUTXN9NYaGNHX';
// hash
$key = hash('sha256', $secret_key);
@puncoz
puncoz / PDO_Database.php
Created December 8, 2015 15:50
PDO database abstraction layer that you can use in your applications to allow for future flexibility in your database choice and protect you from SQL Injection.
<?php
// Define configuration
// May Include this in database configuration file
define("DB_HOST", "localhost");
define("DB_USER", "username");
define("DB_PASS", "password");
define("DB_NAME", "database");
/*
@puncoz
puncoz / speaking_in_tongues_soln.cpp
Created April 11, 2015 09:52
A. Speaking in Tongues
/* A. Speaking in Tongues [filename: A.cpp]
Codejam :: Qualification Round 2012
---------------------------------------------
Written in C++ Programming
Tested and Compiled - Microsoft Windows 7 / Dev-C++ v4.9
*/