Skip to content

Instantly share code, notes, and snippets.

View codeasashu's full-sized avatar
🌊
Waiting to sail

ashutosh chaudhary codeasashu

🌊
Waiting to sail
View GitHub Profile
@codeasashu
codeasashu / 0_reuse_code.js
Created March 14, 2017 15:48
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@codeasashu
codeasashu / install_wp.sh
Created March 14, 2017 21:58
Single click latest wordpress installation
#!/bin/bash
# Bash script to install latest wordpress from repo
#Uses wget
#Download latest wordpress
wget -O latest.tar.gz "https://wordpress.org/latest.tar.gz"
#Extract contents
tar xvzf latest.tar.gz
@codeasashu
codeasashu / Docker_jekyll
Created March 27, 2017 23:00
Some good dockerfiles. Files are appended by their project stack
FROM ruby:2.1
MAINTAINER graham@grahamc.com
RUN apt-get update \
&& apt-get install -y \
node \
python-pygments \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/
@codeasashu
codeasashu / README.md
Created May 12, 2017 17:40 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.

For more about AWS and AWS Certifications and updates to this Gist you should follow me @leonardofed


function replaceUrlParam(url, paramName, paramValue){
if(paramValue == null)
paramValue = '';
var finalurl = null;
var pattern = new RegExp('\\b('+paramName+'=).*?(&|$)');
if(url.search(pattern)>=0){
if(paramValue == ''){
finalurl = url.replace(pattern,'$2');
if(finalurl.substr(finalurl.length - 1) == '?'){
@codeasashu
codeasashu / regex101.txt
Last active June 1, 2017 13:24
Some regex collection
##Username regex
^[a-zA-Z0-9]+$
This only allows alphanumeric
##Password regex
^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8,}$
This regex will enforce these rules:
At least one upper case english letter, (?=.*?[A-Z])
@codeasashu
codeasashu / sql_without_fullmode.sql
Last active June 15, 2017 13:58
SET SQl to be used without fullmode only
#After login to mysql
## mysql -u <username> -p<password>
#Then execute following command:
SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));
#@link: https://stackoverflow.com/a/36033983/7733768
@codeasashu
codeasashu / cert-renew.txt
Created June 23, 2017 11:49
Certbot renew
certbot-auto renew
@codeasashu
codeasashu / web_test_checklist.md
Created June 23, 2017 14:00
Web Testing checking (some hidden defactos)

##For a SSL (https) enabled website:

  1. Press f12 and see the error console screen and check for any errors which looks something like this:

The page at was loaded over HTTPS, but requested an insecure script . This request has been blocked; the content must be served over HTTPS. this usually means the target website (to be tested) is https enabled but it is using some CSS or JavaScript which is not in a https server. Report to developer

Fake API data: http://jsonplaceholder.typicode.com/
JSON Server: https://github.com/typicode/json-server
API Documentation and blueprint: https://apiblueprint.org/
API testing using blueprint: http://dredd.readthedocs.io/en/latest/quickstart/
DateTime: Carbon library
use Database Migrator library