Skip to content

Instantly share code, notes, and snippets.

View pragyanatvade's full-sized avatar
🐢
On a mission to make software development easier.

Pragyan Tripathi pragyanatvade

🐢
On a mission to make software development easier.
View GitHub Profile
@pragyanatvade
pragyanatvade / nexus_linux
Last active September 5, 2022 07:38
Nexus 5 - MTP Driver Linux Mint
Step 1: Setting > About Phone > Start Tapping (7 times) on Build number option 'you are now developer'.
Setting > Developer Options > Enable USB Debugging
Step 2: sudo apt-get instal mtp-tools mtpfs
Step 3: sudo gedit /etc/udev/rules.d/51-android.rules
#LG – Nexus 5
ATTR{idVendor}=="18d1", ATTR{idProduct}=="4ee7", MODE=”0666"
Step 4: sudo chmod +x /etc/udev/rules.d/51-android.rules

Keybase proof

I hereby claim:

  • I am heypragyan on github.
  • I am pragyan (https://keybase.io/pragyan) on keybase.
  • I have a public key ASC1CGIMKcozgd4LL1G7CmxbSM6X7L40AofJCJ-hgxx00wo

To claim this, I am signing this object:

@pragyanatvade
pragyanatvade / number_to_words.clj
Created February 18, 2022 14:48
Clojure library to convert number to words
(ns number-to-words
(:require [clojure.string :as cstr]))
(def ^:private log10 #(java.lang.Math/log10 %))
(def ^:private char->int #(Character/getNumericValue %))
(def ^:private number-map
{0 ""
1 "one"
@pragyanatvade
pragyanatvade / metabase.clj
Last active November 22, 2021 09:50
SQL Query Generation
(ns metabase
(:require
[clojure.walk :as cwalk]
[clojure.string :as cstr]))
(defmulti gen-limit-str
{:arglist '([env limit])}
(fn [env limit]
(if (number? limit)
(:dialect env)
@pragyanatvade
pragyanatvade / fashion_stats.md
Created March 20, 2015 12:19
Statistics of fashion Industry
  1. The world clothing and textile industry (clothing, textiles, footwear and luxury goods) reached almost $2,560 trillion in 2010.
  2. The world childrenswear market is expected to reach beyond $186 billion in 2014, marking a 15 percent increase in five years.
  3. The world bridalwear market is expected to reach almost $57 billion by 2015.
  4. The world menswear industry should exceed $402 billion in 2014.
  5. The world womenswear industry is expected to pass $621 billion in 2014.
  6. The world market for textiles made from organically grown cotton was worth over $5 billion in 2010.
  7. In 2010, American households spent, on average, $1,700 on apparel, footwear, and related products and services.
  8. Manhattanites spend the most on apparel at $362 per month.
  9. Shoppers in Tuscon, Arizona spend the least on apparel: $131 per month.
  10. Catherine, Duchess of Cambridge has spent more than £35,000 $54,000 on clothes since the beginning of 2012.
@pragyanatvade
pragyanatvade / cuda_install.md
Last active August 20, 2016 03:49
Installing CUDA 6.5 In Linux Mint 17

Setting Up CUDA Repository

Cuda Downloads

sudo dpkg -i cuda-repo-ubuntu1404_6.5-14_amd64.deb

sudo apt-get update

@pragyanatvade
pragyanatvade / recursion.js
Created March 30, 2016 09:24
Recursion pattern in javascript
CategorySchema.statics.getLineage = function (categoryId, flag, done) {
var self = this;
var count1 = 0;
var count2 = 0;
var recurse = function (id, results) {
var deferred = Promise.defer();
self.findById(id, function(error, category) {
if (error) {
// Restify Server CheatSheet.
// More about the API: http://mcavage.me/node-restify/#server-api
// Install restify with npm install restify
// 1.1. Creating a Server.
// http://mcavage.me/node-restify/#Creating-a-Server
var restify = require('restify');
@pragyanatvade
pragyanatvade / Mirror.sh
Last active August 29, 2015 14:25
Shell Script to find nearest ubuntu mirror and localtimezone
## set local/fastest mirror and local timezone
mv /etc/apt/sources.list /etc/apt/sources.list.orig
cat > /etc/apt/sources.list <<EOF
deb mirror://mirrors.ubuntu.com/mirrors.txt trusty main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt trusty-updates main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt trusty-backports main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt trusty-security main restricted universe multiverse
@pragyanatvade
pragyanatvade / regex.md
Created July 5, 2015 12:04
Regular Expressions

Starts with: abc Ends with: xyz Contains: 123 Doesn't contain: 456

  1. OR /^abc|xyz$|123|^(?:(?!456).)*$/

  2. AND /^(?=^abc)(?=.*xyz$)(?=.*123)(?=^(?:(?!456).)*$).*$/