Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Noushad PP noushad-pp

🏠
Working from home
View GitHub Profile
@noushad-pp
noushad-pp / Pantheon Terminal Color pallette
Created Jun 19, 2018
Color pallete for pantheon terminal for elementary os
View Pantheon Terminal Color pallette
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 Jan 24, 2018
How to atomically delete keys matching a pattern using Redis
View redis_pattern_del.js
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 Jan 24, 2018
calculate the bounds of a map manually given a center and a radius
View map_bounds_from_center_and_radius.js
// 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;
You can’t perform that action at this time.