Skip to content

Instantly share code, notes, and snippets.

View vikalpj's full-sized avatar
🎯
Focusing

Vikalp Jain vikalpj

🎯
Focusing
View GitHub Profile
# Sentry Setup
1. Install sentry from
https://docs.docker.com/engine/installation/linux/ubuntulinux/
2. Start Docker
sudo service docker start
3. Install nginx on server
sudo apt-get install nginx
@vikalpj
vikalpj / auto-deploy.md
Created September 2, 2016 20:43 — forked from domenic/0-github-actions.md
Auto-deploying built products to gh-pages with Travis

Auto-deploying built products to gh-pages with Travis

This is a set up for projects which want to check in only their source files, but have their gh-pages branch automatically updated with some compiled output every time they push.

Create a compile script

You want a script that does a local compile to e.g. an out/ directory. Let's call this compile.sh for our purposes, but for your project it might be npm build or gulp make-docs or anything similar.

The out/ directory should contain everything you want deployed to gh-pages. That almost always includes an index.html.

@register.inclusion_tag('admin/submit_line.html', takes_context=True)
def submit_row(context):
"""
Displays the row of buttons for delete and save.
"""
ctx = original_submit_row(context)
ctx.update({
'show_save_and_add_another': context.get('show_save_and_add_another', ctx['show_save_and_add_another']),
'show_save_and_continue': context.get('show_save_and_continue', ctx['show_save_and_continue']),
1. Create a set of ssh keys using
ssh-keygen -t rsa -b 4096 -C "<email> "
Note: the keep the file name to be `id_rsa_nginfinite` if you change the file name then make sure you replace the references of id_rsa_nginfinite in the `make-bower-build.sh`
2. Go to https://github.com/sroze/ngInfiniteScroll-bower/settings/keys and add the .pub key here, Also make sure that this has Write access, so that travis should be able to push the commits
3. In the `ngInfiniteScroll` repo encrypt the private key
travis encrypt-file <private_key_name>

Keybase proof

I hereby claim:

  • I am vikalpj on github.
  • I am mevikalp (https://keybase.io/mevikalp) on keybase.
  • I have a public key ASC1swPrGPz6y7HxfcSV81k1ll0BqcDzPhShPqUc3Nq07Qo

To claim this, I am signing this object:

@vikalpj
vikalpj / allauth_avatar.py
Created May 30, 2017 19:08 — forked from pennersr/allauth_avatar.py
Support for copying profile pictures into django-avatar was removed from django-allauth. This gist contains example code that you can drop into your own project in order to reinstate that functionality.
import urllib2
from django.template.defaultfilters import slugify
from django.core.files.base import ContentFile
from django.dispatch import receiver
from avatar.models import Avatar
from allauth.account.signals import user_signed_up
@vikalpj
vikalpj / nginx.conf
Created September 16, 2017 20:18 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@vikalpj
vikalpj / wp-permissions-script
Created September 20, 2017 10:35 — forked from macbleser/wp-permissions-script
WordPress Permissions Configuration Script
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro
#
WP_OWNER=changeme # &lt;-- wordpress owner
WP_GROUP=changeme # &lt;-- wordpress group
WP_ROOT=/home/changeme # &lt;-- wordpress root directory
@vikalpj
vikalpj / bash git, python venv, ruby gemset prompt
Last active June 2, 2022 13:18
Terminal promt to show python env and git branches states
# Add this to your bash profile.
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
BLUE="\[\033[1;34m\]"
NO_COLOUR="\[\033[0m\]"
CYAN="\[\033[0;36m\]"
PURPLE="\[\033[0;35m\]"
@vikalpj
vikalpj / wp-query-ref.php
Created October 4, 2017 11:46 — forked from luetkemj/wp-query-ref.php
WP: Query $args
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/query.php
*/
$args = array(