Skip to content

Instantly share code, notes, and snippets.

View rakeshjuyal's full-sized avatar

Rakesh rakeshjuyal

View GitHub Profile
@rakeshjuyal
rakeshjuyal / USPS Passport appointment.js
Created July 13, 2021 17:42
Find Passport appointment slot @ USPS
/*
Working fine as of 7/13/2021
1. Goto https://tools.usps.com/rcas.htm?locationId=1371262
2. Edit location. Use your zip code.
3. Find all nearby USPS ( code below )
4. Modify var nearbyUPS and var howManyDays ( may be keep it 30 days ).
5. Once everything ran successfully, log uspsGist.vars on console to see slots in all USPS.
*/
@rakeshjuyal
rakeshjuyal / filesbydate.py
Created June 17, 2019 21:21
Copy/Arrange files from source directory on the basis of creation date ( Year , Month )
'''
My first python program. So no exepection of optimized code ;)
What did I learn:
1. We can't concatenate String with integer/boolean... Use '{} {}'.format(var1, var2);
2. os Module have almost everything about Files and Directory.
3. os.walk returns files in subDirectory also. os.listDir returns file in currentDirectory only ( which we need ). os.scanDir can be faster in many cases
https://docs.python.org/3/library/os.html
/* useless plugin # 4
Remove Pinetrest and Quora naggers
*/
window.useless = window.useless || {};
useless.remove = function( elements ){
for ( var nagCounter = 0; nagCounter < elements.length; nagCounter++ ) {
elements[nagCounter] && elements[nagCounter].parentNode && elements[nagCounter].parentNode.removeChild(elements[nagCounter]);
}
};
@rakeshjuyal
rakeshjuyal / Useful GIT resources.log
Last active August 29, 2015 14:13
Useful GIT resources
_GIT SCM_ Basic to the point
http://git-scm.com/book/en/v2/Git-Basics-Undoing-Things
http://git-scm.com/book/en/v2/Git-Branching-Branches-in-a-Nutshell
http://git-scm.com/book/en/v2/Git-Branching-Basic-Branching-and-Merging
@rakeshjuyal
rakeshjuyal / retinafy.less
Last active August 29, 2015 14:12
LESS mixin for retina images. ( _2x image for retina devices ). Direct port of https://gist.github.com/rakeshjuyal/0b2c614ca987a1f04ded
/*
Direct port of https://gist.github.com/rakeshjuyal/0b2c614ca987a1f04ded
Converted scss mixin to less.
*/
.retinafy(@file, @type : png, @width : auto, @height : auto, @suffix : _2x) {
background-image: url("@{file}.@{type}");
@media (min--moz-device-pixel-ratio: 1.3),
(-o-min-device-pixel-ratio: 2.6/2),
(-webkit-min-device-pixel-ratio: 1.3),
@rakeshjuyal
rakeshjuyal / retinafy.scss
Last active August 29, 2015 14:12
mixin for retina images. ( _2x image for retina devices ).
/*
This is very basic mixin I created to cater retina images ( 2x ).
Modify this to suit your requirement.
*/
@mixin retinafy($file, $type : png, $width : auto, $height : auto, $suffix : _2x) {
background-image: url($file + '.' + $type);
@media (min--moz-device-pixel-ratio: 1.3),
(-o-min-device-pixel-ratio: 2.6/2),
(-webkit-min-device-pixel-ratio: 1.3),
@rakeshjuyal
rakeshjuyal / Track Focused Element ( tab only )
Last active December 20, 2015 03:59
Useless Snippet #2 ( Track focused element )
var focusedElemWrap = undefined;
$('.useless-focus-marker').remove(); //Uncomment if you want to reset
if ( $('.useless-focus-marker').length == 0 ){
$('<div class="useless-focus-marker">').css({
position:'absolute',
border:'1px solid rgba(100,100,200,0.7)',
'box-shadow':'0px 2px 12px rgba(50, 50, 50, 0.75)',
width:0,
height:0,
@rakeshjuyal
rakeshjuyal / gist:4748875
Created February 10, 2013 08:23
Nice Horizontal rule <hr/>
hr1{
height: 3px;
border: 0px;
background: -webkit-linear-gradient(left, fff, 000, fff );
}
@rakeshjuyal
rakeshjuyal / notepad-in-browser.html
Created January 30, 2013 04:43
notepad in browser Copied from [ https://coderwall.com/p/lhsrcq ]
data:text/html, <title>Text Editor</title><body contenteditable style="font-size:2rem;line-height:1.4;max-width:60rem;margin:0 auto;padding:4rem;">