Skip to content

Instantly share code, notes, and snippets.

View kedar2a's full-sized avatar
🎯
Focusing

Kedar Aitawdekar kedar2a

🎯
Focusing
  • Fynd
  • Mumbai
View GitHub Profile
@kedar2a
kedar2a / python-programs.py
Created September 5, 2018 13:45
Tiny Python Snippets
def rec_split(arr=[], start=0, end=0):
'''
Recursively split list by 2 till end of all sublists to
have leaf list of length 1.
Example:
>>> sl = [2,3,4, 99, 76,12, 5]
>>> rec_split(sl)
[2, 3, 4]
[99, 76, 12, 5]
[2]
@kedar2a
kedar2a / uninstall-install-nodejs.md
Last active May 23, 2022 17:06
nodejs: Removing and installing

Removing existing node, nodejs and npm (if installed previously):

  • apt-get remove nodejs npm node
  • sudo apt-get purge nodejs npm node
  • sudo rm -rvf /usr/local/bin/npm /usr/local/share/man/man1/node* /usr/local/lib/dtrace/node.d ~/.npm ~/.node-gyp /opt/local/bin/node opt/local/include/node /opt/local/lib/node_modules
  • sudo rm -rfv /usr/local/lib/node*
  • sudo rm -rfv /usr/local/include/node*
  • sudo rm -rfv /usr/local/bin/node*

@kedar2a
kedar2a / enrollment_notes.md
Last active April 19, 2018 10:12 — forked from katkamrachana/enrollment_notes.md
Enrollement module

I. Present Enrollment module

[A]. Actions prevented without Enrollment:

  1. Post comment
  2. Add rating
  3. File upload
  4. Note creation

[B]. Post-Enrollment :

Background:

  • This is a JS/HTML interactive created by Harshit, HBCSE. Planning to get integrated in activity pages as like other CLIx interactives. Generated data will get saved under defined folder hierarchy as JSON file.

Implementation Objectives:

  • It should be easy to embed in multiple activity pages.
  • It should play as like other interactives within activities.
  • While students playing the interactive, it should track each and every step and log those detailed data along with inputs and each iterations.
  • User Generated Data (UGD) should get persists to server.
  • Data persistance should happen at following events:
@kedar2a
kedar2a / curl.md
Created November 21, 2017 10:37 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@kedar2a
kedar2a / bobp-python.md
Created November 20, 2017 06:09 — forked from sloria/bobp-python.md
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@kedar2a
kedar2a / useful-git-commands.git
Last active August 6, 2017 09:19
Handy git commands
**1. GIT LOG WITH COMMIT-NO, DATE, AUTHOR, COMMIT-NAME**
git log --oneline --name-only --pretty="%h %cd, %an : %s" 7b32cc4...27537cc
OUTPUT:
27537cc Fri Aug 4 12:37:34 2017 +0530, Kedar Aitawdekar : Merge pull request #1794 from Prachirb/dlkit
f4ef8e1 Fri Aug 4 12:35:21 2017 +0530, saurabh : Merge pull request #1780 from kedar2a/dlkit-dev
847ee1e Thu Aug 3 19:12:48 2017 +0530, Prachirb : Interaction settings UI modifications
gnowsys-ndf/gnowsys_ndf/ndf/static/ndf/css/themes/clix/clix2017.css
root@dlkit-i2c:/home/docker/code/gstudio/gnowsys-ndf/qbank-lite# pip install cffi==1.7.0
Downloading/unpacking cffi==1.7.0
Downloading cffi-1.7.0.tar.gz (400kB): 400kB downloaded
Running setup.py (path:/tmp/pip_build_root/cffi/setup.py) egg_info for package cffi
Requirement already satisfied (use --upgrade to upgrade): pycparser in /usr/local/lib/python2.7/dist-packages (from cffi==1.7.0)
Installing collected packages: cffi
Running setup.py install for cffi
building '_cffi_backend' extension
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DUSE__THREAD -I/usr/include/ffi -I/usr/include/libffi -I/usr/include/python2.7 -c c/_cffi_backend.c -o build/temp.linux-x86_64-2.7/c/_cffi_backend.o
@kedar2a
kedar2a / Dropdown-with-HTML5-Datalist.html
Last active October 22, 2016 15:17
Dropdown with HTML5 Datalist, enables built-in search and showing options in dropdown
<!DOCTYPE html>
<html>
<head>
<title>Dropdown with HTML5 Datalist</title>
<style type="text/css">
datalist{
display: none;
}
select{
width: 100%;