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 / 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
@Chitrank-Dixit
Chitrank-Dixit / lexical_analyser.py
Last active October 7, 2022 16:40
The following Python Program takes the C program and Perform Lexical analysis over a simple C program (Very Buggy Program need to fix more instances)
# The Following Program would work as Lexical Analyser
#
# Write a C/C++ program which reads a program written
# in any programming language (say C/C++/Java) and then perform
# lexical analysis. The output of program should contain the
# tokens i.e. classification as identifier, special symbol, delimiter,
# operator, keyword or string. It should also display the number of
# identifiers, special symbol, delimiter, operator, keyword, strings
# and statements
@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 / linkedin_data.php
Created December 26, 2013 14:26
Get Data from Linkedin after authorization
<?php
// Change these
define('API_KEY', 'Your App API KEY' );
define('API_SECRET', 'Your App API SECRET' );
define('REDIRECT_URI', 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['SCRIPT_NAME']);
define('SCOPE', 'r_fullprofile r_emailaddress rw_nus' );
// You'll probably use a database
session_name('linkedin');
session_start();
@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