Skip to content

Instantly share code, notes, and snippets.


Anjaneyulu Batta AnjaneyuluBatta505

View GitHub Profile
client = boto3.client(
'cognito-idp', region_name="ap-southeast-1",
'aws_access_key_id': "",
'aws_secret_access_key': ""
cd ~/project/payslip-visualisation/
branch="$(git name-rev --name-only HEAD)"
git checkout $branch
git pull origin $branch
source ~/.virtualenvs/finklim/bin/activate
pip install -r requirements.txt
python migrate
python collectstatic --no-input
sudo supervisorctl restart all
import glob, os
import pathlib
from django.apps import apps
from django.db.models.fields.related import OneToOneField, ForeignKey
from collections import OrderedDict
from django.template import Template, Context
from django.db import connection
def execute_raw_sql(query):
AnjaneyuluBatta505 / main.go
Created Apr 1, 2020 — forked from konojunya/main.go
Sample using gin's BindJSON
View main.go
package main
import (
type CreateParams struct {
AnjaneyuluBatta505 /
Created Feb 21, 2020 — forked from josegonzalez/
A simple script to migrate all keys from one Redis to another
#!/usr/bin/env python
import argparse
import redis
def connect_redis(conn_dict):
conn = redis.StrictRedis(host=conn_dict['host'],
return conn
AnjaneyuluBatta505 /
Created Sep 13, 2019 — forked from taylor224/
Python WiFi Example
# -*- coding: utf-8 -*-
import wifi
def Search():
wifilist = []
cells = wifi.Cell.all('wlan0')
AnjaneyuluBatta505 / element_in_viewport.js
Created May 27, 2019
check if element is in viewport
View element_in_viewport.js
function elementInViewport2(el) {
var top = el.offsetTop;
var left = el.offsetLeft;
var width = el.offsetWidth;
var height = el.offsetHeight;
while(el.offsetParent) {
el = el.offsetParent;
top += el.offsetTop;
left += el.offsetLeft;
View fetch-requests.js
const getQueryString = params => {
return Object.keys(params)
.map(k => {
if (Array.isArray(params[k])) {
return params[k]
.map(val => `${encodeURIComponent(k)}[]=${encodeURIComponent(val)}`)
return `${encodeURIComponent(k)}=${encodeURIComponent(params[k])}`;
AnjaneyuluBatta505 / Loading.js
Created Apr 9, 2019
react js loading component
View Loading.js
import React, { Component } from "react";
import { ActivityIndicator, View } from "react-native";
import {StyleSheet} from 'react-native'
const styles = StyleSheet.create({
loading: {
flex: 1,
flexDirection: "row",
alignItems: 'center'