Skip to content

Instantly share code, notes, and snippets.

View Chitrank-Dixit's full-sized avatar
🎯
Focusing

Chitrank Dixit Chitrank-Dixit

🎯
Focusing
View GitHub Profile
@Chitrank-Dixit
Chitrank-Dixit / response.html
Created January 21, 2020 12:06
response html for ygpartner edit partner
<!DOCTYPE html>\n
<html lang="en">
\n
<head>
\n
<meta charset="UTF-8">
\n
<title>\n YGPartner - \n </title>
\n <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>\n
</head>
@Chitrank-Dixit
Chitrank-Dixit / google_pkce_flow.py
Last active September 20, 2019 14:46
Google API Oauth Authorization code with PKCE Flow
def base64URLEncode(random_bytes):
return base64.urlsafe_b64encode(random_bytes)
def usha256(buffer):
return sha256(buffer).digest()
client_id = 'your-client-id'
client_secret = 'your-client-secret'
redirect_uri = 'your-redirect-uri'
@Chitrank-Dixit
Chitrank-Dixit / powerlevel9k.zsh-theme
Created March 30, 2019 19:21 — forked from kagarlickij/powerlevel9k.zsh-theme
This is my config for Powerlevel9k theme for ZSH located in ~/.oh-my-zsh/custom/themes/powerlevel9k
# vim:ft=zsh ts=2 sw=2 sts=2 et fenc=utf-8
################################################################
# powerlevel9k Theme
# https://github.com/bhilburn/powerlevel9k
#
# This theme was inspired by agnoster's Theme:
# https://gist.github.com/3712874
################################################################
################################################################
@Chitrank-Dixit
Chitrank-Dixit / mongo_to_csv.py
Created March 22, 2019 08:01 — forked from mieitza/mongo_to_csv.py
python mongo to csv use pandas.
# @Author: xiewenqian <int>
# @Date: 2016-11-28T20:35:09+08:00
# @Email: wixb50@gmail.com
# @Last modified by: int
# @Last modified time: 2016-12-01T19:32:48+08:00
import pandas as pd
from pymongo import MongoClient
@Chitrank-Dixit
Chitrank-Dixit / postgres-brew.md
Created April 16, 2018 18:08 — forked from sgnl/postgres-brew.md
Installing Postgres via Brew (OSX) (outdated see top most note)

Outdated note: the process is a lot easier now: after you brew install postgresql you can initialize or stop the daemon with these commands: brew services start postgresql or brew services stop postgresql.

new out put may look like

To have launchd start postgresql now and restart at login:
  brew services start postgresql
Or, if you don't want/need a background service you can just run:
  pg_ctl -D /usr/local/var/postgres start
@Chitrank-Dixit
Chitrank-Dixit / stc.py
Created July 19, 2017 13:21 — forked from tessus/stc.py
Epoch Converter in Python
#!/usr/bin/python
import time, argparse
def convert(ctx):
inputstr = str(ctx.Epoch)
if len(inputstr) > 10:
secs = inputstr[:10]
msecs = inputstr[10:]
@Chitrank-Dixit
Chitrank-Dixit / people_export.py
Created July 10, 2017 10:46 — forked from drmarshall/people_export.py
Example Mixpanel raw People export script
#! /usr/bin/env python
#
# Mixpanel, Inc. -- http://mixpanel.com/
#
# Python API client library to consume mixpanel.com analytics data.
import hashlib
import time
import urllib #for url encoding
import urllib2 #for sending requests
@Chitrank-Dixit
Chitrank-Dixit / event_export.py
Created July 10, 2017 09:55 — forked from drmarshall/event_export.py
Example Mixpanel raw event export script
#! /usr/bin/env python
#
# Mixpanel, Inc. -- http://mixpanel.com/
#
# Python API client library to consume mixpanel.com analytics data.
import hashlib
import urllib
import time
try:
@Chitrank-Dixit
Chitrank-Dixit / event_export.py
Created July 8, 2017 08:41 — forked from wgins/event_export.py
Example Mixpanel raw event export script Raw
#! /usr/bin/env python
#
# Mixpanel, Inc. -- http://mixpanel.com/
#
# Python API client library to consume mixpanel.com analytics data.
#
# Copyright 2010-2013 Mixpanel, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@Chitrank-Dixit
Chitrank-Dixit / people2csv.py
Last active June 26, 2023 13:17 — forked from wgins/people2csv.py
Mixpanel - Exporting people profiles to CSV
PROJECT_TOKEN = "<mixpanel-project-token>"
API_SECRET = "<mixpanel-project-api-secret>"
#from mixpanel import Mixpanel
#mp = Mixpanel(PROJECT_TOKEN)
#dir(mp)
''' people export'''
import base64
import csv