Skip to content

Instantly share code, notes, and snippets.

View noushad-pp's full-sized avatar
🏠
Working from home

Noushad noushad-pp

🏠
Working from home
View GitHub Profile
@noushad-pp
noushad-pp / .editorconfig
Last active November 25, 2020 16:20
Eslint + EditorConfig + Prettier configs - web
# editorconfig.org
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
@noushad-pp
noushad-pp / Pantheon Terminal Color pallette
Created June 19, 2018 12:55
Color pallete for pantheon terminal for elementary os
p="#000000:#c86657:#57c866:#b9c857:#6657c8:#c857b9:#57b9c8:#c2c2c2:#3a3a3a:#e6b9b2:#b2e6b9:#dfe6b2:#b9b2e6:#e6b2df:#b2dfe6:#ffffff"
f="#f2f8d3"
b="#06142d"
gsettings set org.pantheon.terminal.settings palette "$p"
gsettings set org.pantheon.terminal.settings foreground "$f"
gsettings set org.pantheon.terminal.settings background "$b"
@noushad-pp
noushad-pp / redis_pattern_del.js
Created January 24, 2018 16:41
How to atomically delete keys matching a pattern using Redis
EVAL "return redis.call('del', unpack(redis.call('keys', ARGV[1])))" 0 prefix:*
@noushad-pp
noushad-pp / map_bounds_from_center_and_radius.js
Created January 24, 2018 16:39
calculate the bounds of a map manually given a center and a radius
// formula to find the South west and North East points from lat,lon between x kms in radius.
let center = {
lat: 73.1232145,
lng: 221.1234567
};
let radius = 10;
let lat_change = radius/111;
let lon_change = Math.abs(Math.cos(center.lat *(Math.PI/180)));
let sw_lat = center.lat - lat_change;
let sw_lon = center.lng - lon_change;