Skip to content

Instantly share code, notes, and snippets.

View eagleyed's full-sized avatar
🏠
Working from home

Rituparna sonowal eagleyed

🏠
Working from home
  • Individual
  • Kolkata, India
View GitHub Profile
@eagleyed
eagleyed / class-woocommerce-order-status.php
Created August 13, 2020 18:15 — forked from yratof/class-woocommerce-order-status.php
Custom order status for Woocommerce
<?php
class order_status_customisation {
/**
* Setup actions
*/
static function setup() {
add_action( 'init', __CLASS__ . '::adding_additional_order_statuses', 10 );
add_filter( 'wc_order_statuses', __CLASS__ . '::add_awaiting_shipment_to_order_statuses', 10, 1 );
@eagleyed
eagleyed / wc-automatically-complete-orders.php
Created August 7, 2020 10:58
[Frontend Snippets] Automatically complete all orders
/**
* Auto Complete all WooCommerce orders.
*/
add_action( 'woocommerce_thankyou', 'custom_woocommerce_auto_complete_order' );
function custom_woocommerce_auto_complete_order( $order_id ) {
if ( ! $order_id ) {
return;
}
$order = wc_get_order( $order_id );
@eagleyed
eagleyed / ssh-digital-ocean
Created June 26, 2020 17:13
SSH first time connection to Digital Ocean Account
Generate the key: ssh-keygen
Point to the directory with your key pair
cd ~/.ssh
locate the pub key for ssh
ssh-copy-id -i [key_name].pub USERNAME@SERVERT_IP
Then
@eagleyed
eagleyed / webpack.config.js
Created June 10, 2020 10:24 — forked from wpscholar/webpack.config.js
Get started with WebPack in WordPress today!
'use strict';
const autoprefixer = require('autoprefixer');
const browsers = require('@wordpress/browserslist-config');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const path = require('path');
const webpack = require('webpack');
module.exports = function (env, options) {
@eagleyed
eagleyed / docker_wordpress.md
Created May 5, 2020 12:05 — forked from bradtraversy/docker_wordpress.md
Docker Compose FIle For Wordpress, MySQL & phpmyadmin

Wordpress & Docker

This file will setup Wordpress, MySQL & PHPMyAdmin with a single command. Add the code below to a file called "docker-compose.yaml" and run the command

$ docker-compose up -d

# To Tear Down
$ docker-compose down --volumes

MySQL Cheat Sheet

Help with SQL commands to interact with a MySQL database

MySQL Locations

  • Mac /usr/local/mysql/bin
  • Windows /Program Files/MySQL/MySQL version/bin
  • Xampp /xampp/mysql/bin

Add mysql to your PATH

MongoDB Cheat Sheet

Show All Databases

show dbs

Show Current Database

@eagleyed
eagleyed / python_heroku.MD
Created May 5, 2020 10:12 — forked from bradtraversy/python_heroku.MD
Python & Postgres Heroku Deployment

Python Heroku Deployment

Steps to create a postgres database and deply a Python app to Heroku

Install guinicorn locally

pipenv install gunicorn
or
pip install gunicorn
@eagleyed
eagleyed / node_nginx_ssl.md
Created May 5, 2020 10:03 — forked from bradtraversy/node_nginx_ssl.md
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

@eagleyed
eagleyed / scrapy.md
Created May 5, 2020 10:00 — forked from bradtraversy/scrapy.md
Scrapy commands and code