Skip to content

Instantly share code, notes, and snippets.

View abhinavlal's full-sized avatar

Abhinav Lal abhinavlal

View GitHub Profile
@abhinavlal
abhinavlal / reset_autoincrement.sh
Created January 19, 2013 08:45
Reset auto increment of all tables in a mysql database
mysql -Nsr -e "SELECT t.table_name FROM INFORMATION_SCHEMA.TABLES t WHERE t.table_schema = 'DB_NAME'" | xargs -I {} mysql DB_NAME -e "ALTER TABLE {} AUTO_INCREMENT = 1;"
[
{
"id": "infoComponent",
"version": "v1",
"content": {
"title": "This is a title",
"subtitle": "This is a subtitle"
},
"events": {
"onView": {
{
"$id": "http://example.com/example.json",
"$schema": "http://json-schema.org/draft-07/schema",
"default": {},
"description": "Defines the component for showing a mini card for doctor pprofile",
"examples": [
{
"id": "myComponent",
"version": "v1",
"content": {
<html>
<head>
<title>CleverTap</title>
<script type="text/javascript">
var clevertap = {event:[], profile:[], account:[], onUserLogin:[], notifications:[], privacy:[]};
// replace with the CLEVERTAP_ACCOUNT_ID with the actual ACCOUNT ID value from your Dashboard -> Settings page
clevertap.account.push({"id": "TEST-86K-4Z9-K85Z"});
clevertap.privacy.push({optOut: false}); //set the flag to true, if the user of the device opts out of sharing their data
clevertap.privacy.push({useIP: false}); //set the flag to true, if the user agrees to share their IP data
(function () {
@abhinavlal
abhinavlal / paytm-transaction.py
Created August 22, 2018 17:16
Code to export
# coding: utf-8
import requests
import csv
jar = requests.cookies.RequestsCookieJar()
paytm_cookie = 'add-your-cookie'
jar.set('connect.sid', paytm-cookie, domain='paytm.com', path='/', secure=True)
url = 'https://paytm.com/v1/api/wallet/txnhistory?page_size=100&page_number='
fieldnames = ['imageUrl', 'narration', "payeeId", "payerId", "txnDescription1", "txnStatus", "txnFrom", "txnTo", "txnamount", "txndate", "txntype", "walletOrderId"]
with open('paytm-test.csv', 'w') as csvfile:

Keybase proof

I hereby claim:

  • I am abhinavlal on github.
  • I am abhinavlal (https://keybase.io/abhinavlal) on keybase.
  • I have a public key whose fingerprint is 51BC E4B1 7C19 DF32 33A8 6738 9908 9C59 EB37 CA92

To claim this, I am signing this object:

import sqlite3
import urllib, re
from flask import Flask, request, jsonify
from dbapi import g, closing, create_contact, get_user_by_email, get_contacts_by_created_by_id, \
get_contact_by_id, update_contacts, delete_entity_contact, get_contacts_by_phone, search_contacts
# configuration
DATABASE = '/home/ubuntu/ui-project/ui-project.db'
DEBUG = True
var a = 2;
function() {
alert(a);
var a = 3;
alert(a);
}
// output for first alert
// output for second alert
@abhinavlal
abhinavlal / pip config
Created March 5, 2013 10:28
Requests send multiple file
WebOb==1.2.3
argparse==1.2.1
requests==0.7.5
wsgiref==0.1.2
<div style="background:url('https://ray.practo.com/images/pvrwidget-red.png');height:36px
!important; width:193px !important;margin:5px !important;line-height:36px !important;
padding:5px 10px 24px 75px !important; text-align:left;font-family:'Arial', Calibri !important; font-size:18px !
important; font-weight:bold !important; color:#FFF !important;text-shadow:1px 1px 0 #A33232
!important;display:inline-block !important;">+91 08050002060</div>
<!------------- correct code ---->
<div style="background:url('https://ray.practo.com/images/pvrwidget-red.png');height:36px
!important; width:193px !important;margin:5px !important;line-height:36px !important;