Skip to content

Instantly share code, notes, and snippets.

View hardiksondagar's full-sized avatar

Hardik Sondagar hardiksondagar

View GitHub Profile
@hardiksondagar
hardiksondagar / security_rules.json
Created December 31, 2015 06:52
Firebase multi-user database structure and security rules
/* Data structure */
{
"users": {
"05ef4bd9-3957-4466-b65d-4a625acc89e0":{
name: "Alan Turing",
email: "alan@turingmachine.com",
roles:{
student:false,
hiring_manager:false,
admin:true
@hardiksondagar
hardiksondagar / index.html
Last active March 7, 2018 12:27
Chrome desktop Notification example
<button onclick="notifyMe()">Notify me!</button>
@hardiksondagar
hardiksondagar / instagramFollowerScrapper.js
Last active June 10, 2023 09:25 — forked from suprememoocow/intercept.js
Instagram follower web scrapper.
/**
*
* Instagram Follower Web Scrapper
*
* Steps to use.
* 1. Open instagram user's profile in browser https://www.instagram.com/tvfpitchers/
* 2. Open console ( press F12 in chrome ) and paste all the code below
* 3. Click on followers button and load all the followers
* 4. Call function downloadAsCsv() by writing "downloadAsCsv()" in console to download csv file containing user's all the followers .
*
@hardiksondagar
hardiksondagar / fa-checkbox-radio.css
Created June 28, 2016 05:26
Custom input checkbox and radio style using fontawesome
.input-fa-list {
padding-top: 7px;
}
.input-fa-radio, .input-fa-checkbox {
display: inline-block;
position: relative;
cursor: pointer;
margin-right: 8px;
}
.input-fa-radio:last-child, .input-fa-checkbox:last-child {
@hardiksondagar
hardiksondagar / BulkMembertAcceptLinkedIn.js
Last active November 7, 2018 11:28
Bulk Accept LinkedIn group member requests
/**
*
* Bulk-Accept LinkedIn group member requests ( For admin )
*
* Tired of acceptig group's pending member request one by one. Follow steps to automate it.
* 1. Go to Pending tab of group i.e. https://www.linkedin.com/groups/YOUR_GROUP_ID/members/pending.
* 2. Open console ( press F12 in chrome ) and paste all the code below.
* 3. Wait while all the requests are accepted.
*
* @author : Hardik Sondagar <hardikmsondagar@gmail.com>
@hardiksondagar
hardiksondagar / susan.sh
Created November 28, 2016 07:23
Organizes downloads folder automatically
# Forked from @January's answer on StackOverflow. http://askubuntu.com/a/184265/123595
#!/bin/bash
# define target directories
DOWNLOADS=$HOME/Downloads
VIDEOS=$HOME/Videos/
PICTURES=$HOME/Pictures/
DOCS=$HOME/Documents/
MUSIC=$HOME/Music/
@hardiksondagar
hardiksondagar / gist:0040a2dd5589158d4e033fdcf16b57c3
Created January 24, 2017 12:46 — forked from thomseddon/gist:3511330
AngularJS byte format filter
app.filter('bytes', function() {
return function(bytes, precision) {
if (isNaN(parseFloat(bytes)) || !isFinite(bytes)) return '-';
if (typeof precision === 'undefined') precision = 1;
var units = ['bytes', 'kB', 'MB', 'GB', 'TB', 'PB'],
number = Math.floor(Math.log(bytes) / Math.log(1024));
return (bytes / Math.pow(1024, Math.floor(number))).toFixed(precision) + ' ' + units[number];
}
});
@hardiksondagar
hardiksondagar / flex-div.css
Created April 5, 2017 11:13
Vertically center a div
.flex-div {
display: flex;
justify-content: center;
align-items: center;
}
@media only screen and (max-width: 768px) {
.flex-div {
display: block;
}
@hardiksondagar
hardiksondagar / README.md
Last active August 14, 2023 01:11
Ubuntu: Bash history search, partial + up-arrow

Both methods below are almost equivalent, it just depends on which file you want to edit. I'd recommend .bashrc myself, as it doesn't involve editing a local copy of a system file.

If you experience any problems with this, please comment below so that it can be fixed.

Using ~/.bashrc

  1. Edit ~/.bashrc with this command:
gedit ~/.bashrc
@hardiksondagar
hardiksondagar / README.md
Last active July 9, 2024 08:31
Download TV shows and movies via shell script

Required

  • lynx

    sudo apt-get install lynx
    

Example