Skip to content

Instantly share code, notes, and snippets.

View zohaib055's full-sized avatar
🎯
Focusing

Zohaib Ahmad zohaib055

🎯
Focusing
  • BizTech247
  • United States
  • 07:15 (UTC -07:00)
  • LinkedIn in/devzohaib
View GitHub Profile
@rojan
rojan / node_crypto.js
Last active March 19, 2023 15:14
Encrypt in nodejs and decrypt in php or vice versa
var crypto = require('crypto');
var key = 'MySecretKey12345';
var iv = '1234567890123456';
var cipher = crypto.createCipheriv('aes-128-cbc', key, iv);
var decipher = crypto.createDecipheriv('aes-128-cbc', key, iv);
var text = 'plain text';
var encrypted = cipher.update(text, 'utf8', 'binary');
encrypted += cipher.final('binary');
hexVal = new Buffer(encrypted, 'binary');
@anchetaWern
anchetaWern / php-webscraping.md
Created August 4, 2013 13:18
web scraping in php

Have you ever wanted to get a specific data from another website but there's no API available for it? That's where Web Scraping comes in, if the data is not made available by the website we can just scrape it from the website itself.

But before we dive in let us first define what web scraping is. According to Wikipedia:

{% blockquote %} Web scraping (web harvesting or web data extraction) is a computer software technique of extracting information from websites. Usually, such software programs simulate human exploration of the World Wide Web by either implementing low-level Hypertext Transfer Protocol (HTTP), or embedding a fully-fledged web browser, such as Internet Explorer or Mozilla Firefox. {% endblockquote %}

@hugowan
hugowan / gist:3096288
Created July 12, 2012 06:32
CodeIgniter cURL Elastic Search Client
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class ElasticSearch {
public $index;
function __construct($config = array('server' => 'http://localhost:9200'))
{
$this->server = $config['server'];
}