Skip to content

Instantly share code, notes, and snippets.

View rohankhudedev's full-sized avatar

Rohan Khude rohankhudedev

View GitHub Profile
@scrapehero
scrapehero / amazon_reviews.py
Last active November 16, 2022 03:43
Python 3 code to extract amazon reviews
View amazon_reviews.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Written as part of https://www.scrapehero.com/how-to-scrape-amazon-product-reviews-using-python/
from lxml import html
from json import dump,loads
from requests import get
import json
from re import sub
from dateutil import parser as dateparser
from time import sleep
@jeffochoa
jeffochoa / Response.php
Last active January 11, 2024 22:00
Laravel HTTP status code
View Response.php
<?php
// This can be found in the Symfony\Component\HttpFoundation\Response class
const HTTP_CONTINUE = 100;
const HTTP_SWITCHING_PROTOCOLS = 101;
const HTTP_PROCESSING = 102; // RFC2518
const HTTP_OK = 200;
const HTTP_CREATED = 201;
const HTTP_ACCEPTED = 202;
@butlerblog
butlerblog / functions.php
Last active February 6, 2024 15:24
SMTP using wp-config.php for settings #smtp #wp_mail
View functions.php
<?php // Don't use this line.
/*
* Add the script below to wherever you store custom code snippets
* in your site, whether that's your child theme's functions.php,
* a custom plugin file, or through a code snippet plugin.
*/
/**
* This function will connect wp_mail to your authenticated
@Ghost---Shadow
Ghost---Shadow / PlaylistLength.js
Last active May 4, 2023 09:05
Calculate the total length of a youtube playlist. Just open javascript console, paste and press enter.
View PlaylistLength.js
/**
USAGE
1. Open the playlist you want
2. Right click > Inspect element > Console
3. Copy this and paste. Hit enter.
4. For watch later make sure to click the Edit button
Make sure &disable_polymer=true flag is set
e.g.
https://www.youtube.com/playlist?list=WL&disable_polymer=true
@devd123
devd123 / longestPalindrome.php
Created April 24, 2017 05:58
Find longest palindrome string in php
View longestPalindrome.php
<?php
/**
* find the longest palindrome in a string
* website : neerusite.wordpress.com
* Auther : Devdutt Sharma
*/
function longestPalindrome($string = ''){
$strArr = array();
@scrapehero
scrapehero / amazon_review_scraper.py
Last active August 5, 2022 10:59
Python Code to Scrape Customer Reviews from Amazon.com. Read more on https://www.scrapehero.com/how-to-scrape-amazon-product-reviews-using-python/
View amazon_review_scraper.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Written as part of https://www.scrapehero.com/how-to-scrape-amazon-product-reviews-using-python/
from lxml import html
import json
import requests
import json,re
from dateutil import parser as dateparser
from time import sleep
@sladjandr
sladjandr / email-scrape.py
Created October 4, 2016 21:00
Scrape all mailto links from a page - Python
View email-scrape.py
import requests
import xlwt
from bs4 import BeautifulSoup
wb = xlwt.Workbook()
ws = wb.add_sheet('Emails')
ws.write(0,0,'Emails')
emailList= []
@noelboss
noelboss / git-deployment.md
Last active December 25, 2023 16:41
Simple automated GIT Deployment using Hooks
View git-deployment.md

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

View phpStorm + phpMd step by step
How to configure phpStorm with EditorConfig and PHPMD:
-----------------------------------------------------
PHPMD:
------
phpmd (PHP Mess Detector) is a static analysis tool that will find issues in your code you never knew you had. Your code will still run, follow a few of phpmd's recommendations though and it will be better!
phpmd is already bundled and enabled in phpstorm, but in order to more easily manage versions and add custom rulesets, you should do the following: