Skip to content

Instantly share code, notes, and snippets.

View amitjindal's full-sized avatar
🚀
Building SAAS Products

Amit Jindal amitjindal

🚀
Building SAAS Products
View GitHub Profile
@amitjindal
amitjindal / magento-code-snippets.md
Created January 18, 2017 03:09 — forked from arosenhagen/magento-code-snippets.md
[magento] - code snippets

Magento Code Snippets

Download extension manually using mage

./mage config-set preferred_state stable
./mage clear-cache
./mage sync
./mage download community Module_Name
@amitjindal
amitjindal / gist:7438c62f3f62588b023910310711edea
Created November 2, 2017 17:30 — forked from evildmp/gist:3094281
Set up Django, nginx and uwsgi

This document has now been incorporated into the uWSGI documentation:

http://uwsgi-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html

Set up Django, nginx and uwsgi

Steps with explanations to set up a server using:

@amitjindal
amitjindal / cache-warmer.py
Created April 27, 2018 06:53 — forked from hn-support/cache-warmer.py
A threaded cache warmer in python
#!/usr/bin/env python
"""
Warm the caches of your website by crawling each page defined in sitemap.xml.
To use, download this file and make it executable. Then run:
./cache-warmer.py --threads 4 --file /data/web/public/sitemap.xml -v
"""
import argparse
import multiprocessing.pool as mpool
import os.path
import re
@amitjindal
amitjindal / spacemacs-cheshe.md
Last active February 19, 2019 11:13 — forked from robphoenix/spacemacs-cheshe.md
Spacemacs Cheat Sheet

Useful Spacemacs commands

  • SPC q q - quit
  • SPC w / - split window vertically
  • SPC w - - split window horizontally
  • SPC 1 - switch to window 1
  • SPC 2 - switch to window 2
  • SPC w c - delete current window
  • SPC TAB - switch to previous buffer
  • SPC b b - switch buffers
@amitjindal
amitjindal / purgecss-tailwind-gulp-example.js
Created July 14, 2019 17:59 — forked from taylorbryant/purgecss-tailwind-gulp-example.js
Use PurgeCSS with Tailwind & Gulp (Inspired by @andrewdelprete)
const gulp = require('gulp');
const tailwindConfig = "tailwind.js"; /* Path to Tailwind config */
const mainCSS = "src/style.css"; /* Path to main stylesheet */
/**
* Custom PurgeCSS Extractor
* https://github.com/FullHuman/purgecss
*/
class TailwindExtractor {
static extract(content) {
@amitjindal
amitjindal / forms.py
Created December 15, 2019 15:19 — forked from neara/forms.py
Django Class Based Views and Inline Formset Example
from django.forms import ModelForm
from django.forms.models import inlineformset_factory
from models import Sponsor, Sponsorship
class SponsorForm(ModelForm):
class Meta:
model = Sponsor
@amitjindal
amitjindal / jail.local
Created May 1, 2020 17:29 — forked from dale3h/jail.local
[fail2ban] Improved nginx-badbots
# Add to file: /etc/fail2ban/jail.local
[nginx-badbots]
enabled = true
port = http,https
filter = nginx-badbots
logpath = %(nginx_access_log)s
maxretry = 1
findtime = 604800
bantime = 604800
@amitjindal
amitjindal / jail.local
Created May 1, 2020 17:30 — forked from pferrarezi/jail.local
[fail2ban] Improved nginx-badbots
# Copy file /etc/fail2ban/jail.conf to /etc/fail2ban/jail.local
# Add to file: /etc/fail2ban/jail.local
[nginx-badbots] # stop some known malicious bot request patterns:
enabled = true
port = http,https
filter = nginx-badbots
logpath = %(nginx_access_log)s
maxretry = 1