Skip to content

Instantly share code, notes, and snippets.

@vaibhavmule
vaibhavmule / first-things.sh
Last active March 22, 2023 17:58
First Thing To Do After Installing Any Linux OS.
echo "Updating" &&
sudo apt-get update
echo "Upgrading" &&
sudo apt-get dist-upgrade
echo "Cleaning Up" &&
sudo apt-get -f install &&
sudo apt-get autoremove &&
sudo apt-get -y autoclean &&
@vaibhavmule
vaibhavmule / FeedController.py
Created October 10, 2018 11:40
RSS Feed using Masonite Framework
"""A FeedController Module"""
from masonite.view import View
from masonite.request import Request
from app.Post import Post
class FeedController:
"""FeedController
"""
Develop an ETL system that will Extract data from a CSV file,
apply some transformation and output the transformed
data to another CSV.
ETL stands for Extract Transform and Load - this system should be divided into these modules:
Extract module - should be able to retrieve data from a CSV file
Transform module - should accept input stream from Extract module and
for each column adds an additional column
indicating the data type of the column
@vaibhavmule
vaibhavmule / alexa.js
Created October 16, 2017 12:47 — forked from chilts/alexa.js
Getting the Alexa top 1 million sites directly from the server, unzipping it, parsing the csv and getting each line as an array.
var request = require('request');
var unzip = require('unzip');
var csv2 = require('csv2');
request.get('http://s3.amazonaws.com/alexa-static/top-1m.csv.zip')
.pipe(unzip.Parse())
.on('entry', function (entry) {
entry.pipe(csv2()).on('data', console.log);
})
;
@vaibhavmule
vaibhavmule / find_angle_between_hours_and_minutes.py
Last active October 9, 2017 08:20
find_angle_between_hours_and_minutes - https://repl.it/MIr5/7 full_house_or_not - https://repl.it/MSxN/0
def calculate_angle(hour, minute):
"""
Assuming 12 hours is 360 degree which is
(720 minutes) or 0.5 degree per minute
and 60 minutes = 360* which 6 degree per minutes.
"""
if hour == 12 and minute == 60:
hour, minute = 0, 0
angle_of_hour_hand = (60 * hour + minute) / 2
angle_of_minute_hand = 6 * minute
sudo apt-get update && sudo apt-get dist-upgrade
sudo apt-get install netselect-apt -y
sudo netselect-apt
sudo apt-get install sudo chromium vim git git-core zsh vlc libcanberra-gtk-module fonts-crosextra-carlito fonts-crosextra-caladea -y
cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86_64" | tar xzf -
wget "https://www.rescuetime.com/installers/rescuetime_current_amd64.deb"
sudo dpkg -i rescuetime_current_amd64.deb
rm rescuetime_current_amd64.deb
@vaibhavmule
vaibhavmule / ohhdl-ubuntu-install.sh
Last active September 2, 2017 04:27
ohhdl-ubuntu-install.sh
# install git
sudo apt get install git
# install elasticsearch
sudo apt-get install build-essential libssl-dev
wget -qO - https://packages.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
echo "deb http://packages.elastic.co/elasticsearch/2.x/debian stable main" | sudo tee -a /etc/apt/sources.list.d/elasticsearch-2.x.list
sudo apt-get update && sudo apt-get install elasticsearch
# install java
<meta name="twitter:card" content="summary" />
<meta name="twitter:site" content="@nytimesbits" />
<meta name="twitter:creator" content="@nickbilton" />
<meta property="og:url" content="http://bits.blogs.nytimes.com/2011/12/08/a-twitter-for-my-sister/" />
<meta property="og:title" content="A Twitter for My Sister" />
<meta property="og:description" content="In the early days, Twitter grew so quickly that it was almost impossible to add new features because engineers spent their time trying to keep the rocket ship from stalling." />
<meta property="og:image" content="http://graphics8.nytimes.com/images/2011/12/08/technology/bits-newtwitter/bits-newtwitter-tmagArticle.jpg" />
@vaibhavmule
vaibhavmule / learning.md
Created February 16, 2017 20:01 — forked from sibelius/learning.md
Learning Path React Native

Basics

  • Learn how to start a new react native project
  • Run it on ios simulator, on android emulator, on a real iPhone device and on a real Android device, with and without debugging enabled.
  • Learn how to upgrade a react native project
  • Learn how to add a package to the project
  • Learn how to add a package that has a native dependency (https://github.com/airbnb/react-native-maps, https://github.com/evollu/react-native-fcm) - DO NOT USE COCOAPODS
  • Learn how to use fetch to get data from your backend

Learn Navigation

@vaibhavmule
vaibhavmule / drf.md
Last active October 6, 2016 08:46
Django Rest Framework Installation

Installation

pip install django
pip install djangorestframework
pip install django-filter