Skip to content

Instantly share code, notes, and snippets.

View avinash2's full-sized avatar

Avinash K. avinash2

View GitHub Profile
@avinash2
avinash2 / functions.php
Created January 18, 2022 04:34 — forked from lucasjahn/functions.php
Woocommerce Checkout - Display custom inline error messages (including custom validation messages)
<?php
/**
* adds custom js file to handle inline error messages
*/
add_action( 'woocommerce_after_checkout_form', 'add_custom_validation_script', 20 );
function add_custom_validation_script() {
wp_enqueue_script(
@avinash2
avinash2 / etModules-icon-codes.css
Created August 30, 2021 09:19 — forked from SJ-James/etModules-icon-codes.css
A list of the codes for Divi's built in icon collection
/* example of use */
h1:before {
font-family: 'etModules';
content: "\24";
}
/* codes */
.arrow_up:before {
content: "\21";
@avinash2
avinash2 / wordpress-w3tc-site.conf
Created August 26, 2017 05:51 — forked from elivz/wordpress-w3tc-site.conf
Nginx configuration for WordPress with W3 Total Cache plugin. See http://elivz.com/blog/single/wordpress_with_w3tc_on_nginx/
server {
# Redirect yoursite.com to www.yoursite.com
server_name yoursite.com;
rewrite ^(.*) http://www.yoursite.com$1 permanent;
}
server {
# Tell nginx to handle requests for the www.yoursite.com domain
server_name www.yoursite.com;
@avinash2
avinash2 / INSTALL
Created August 25, 2017 19:35 — forked from arya-oss/INSTALL.md
Ubuntu 16.04 Developer Tools installation
###### development tools
sudo apt-get install build-essential python-dev git nodejs-legacy npm gnome-tweak-tool openjdk-8-jdk
### Python packages
sudo apt-get install python-pip python-virtualenv python-numpy python-matplotlib
### pip packages
pip install django flask django-widget-tweaks django-ckeditor beautifulsoup4 requests classifier SymPy ipython
@avinash2
avinash2 / .readme.md
Created December 5, 2016 17:15 — forked from jmyrland/.readme.md
Off canvas menu with touch handles.

Off canvas menu with touch handles.

View an example here.

This example is based on elements of this post.

Incliudes a OffCanvasMenuController to handle touch events bound to the off canvas menu. For example when swiping from the outer left side to the right, the left off canvas menu is dragged along.

Example usage

# say we start with an empty bash command history
bash-3.2$ history
1 history
# enter a command that requires a password
bash-3.2$ sudo rm -i some_file
Password:
# accidentally ^C and type your password
# into the prompt and hit enter
jQuery(function($) {
$('form[data-async]').live('submit', function(event) {
var $form = $(this);
var $target = $($form.attr('data-target'));
$.ajax({
type: $form.attr('method'),
url: $form.attr('action'),
data: $form.serialize(),
@avinash2
avinash2 / node-and-npm-in-30-seconds.sh
Created October 4, 2012 23:46 — forked from isaacs/node-and-npm-in-30-seconds.sh
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://npmjs.org/install.sh | sh