Skip to content

Instantly share code, notes, and snippets.


Rezwan Hossain rezwan-hossain

  • Dhaka
View GitHub Profile
rezwan-hossain / Borders bookmarklet
Created Nov 7, 2020 — forked from ikenfin/Borders bookmarklet
Bookmarklet to show borders for divs
View Borders bookmarklet
javascript:if(!window.__debug_div_borders_inited) { var sheet = document.styleSheets[0]; sheet.insertRule('body.__debug_div_borders div { outline: 1px solid green; }', ((sheet.cssRules && sheet.cssRules.length) || 0)); window.__debug_div_borders_inited = true; } document.body.classList.toggle('__debug_div_borders');void(0);
rezwan-hossain / gist:8f9dbabca6716ee09b8e474ecec0b818
Last active Apr 30, 2020
Shortcut to switch displays focus and cursor on ubuntu
View gist:8f9dbabca6716ee09b8e474ecec0b818
sudo apt install xdotool x11-xserver-utils or sudo apt-get install xdotool
usage: add to this keybord shortcut
To set focus to left screen pass "left" as arg
python3 ./ left
rezwan-hossain / gist:f8a10b2bbb3321ae202ddf6262d83415
Last active Apr 29, 2020
rofi keybinding/shortcut for starting rofi
View gist:f8a10b2bbb3321ae202ddf6262d83415
After install rofi we can type terminal following command to run rofi
rofi show <mode> mode = run or window
we can also add keybord shortcuts to run rofi in lubuntu
go to .config/openbox there you will find lubuntu-rc.xml file this file contain all shortcuts our system
we need to add addition shortcuts
<keybind key="W-space">
<action name="Execute">
View socket-cheatsheet.js (copy)
// sending to sender-client only
socket.emit('message', "this is a test");
// sending to all clients, include sender
io.emit('message', "this is a test");
// sending to all clients except sender
socket.broadcast.emit('message', "this is a test");
// sending to all clients in 'game' room(channel) except sender
rezwan-hossain / path.js
Created Sep 21, 2017 — forked from creationix/path.js
Simple path join and dirname functions for generic javascript
View path.js
// Joins path segments. Preserves initial "/" and resolves ".." and "."
// Does not support using ".." to go above/outside the root.
// This means that join("foo", "../../bar") will not resolve to "../bar"
function join(/* path segments */) {
// Split the inputs into a list of path commands.
var parts = [];
for (var i = 0, l = arguments.length; i < l; i++) {
parts = parts.concat(arguments[i].split("/"));
// Interpret the path commands to get the new resolved path.
rezwan-hossain /
Created Sep 15, 2017 — forked from joyrexus/
Vanilla JS equivalents of jQuery methods

Sans jQuery


// jQuery
$(document).ready(function() {
  // code
View gist:431df2fba1d33cecc01bbf3ca8d80b24
sudo apt-get update
sudo apt-get install postgresql postgresql-contrib
Switching Over to the postgres Account
The installation procedure created a user account called postgres that is associated with the default Postgres role.
In order to use Postgres, we can log into that account.
Switch over to the postgres account on your server by typing:
sudo -i -u postgres
You can now access a Postgres prompt immediately by typing:
rezwan-hossain / git_add_remove.txt
Last active Aug 3, 2017
Remove node_module form git add or git repo
View git_add_remove.txt
git rm -r --cached node_modules
git commit -m ':) ;)'
git push origin master
rezwan-hossain / .babelrc
Created May 25, 2017 — forked from JamieMason/.babelrc
Tree-Shaking with Babel 6, Webpack 2, and React.
View .babelrc
"presets": [
["es2015", {
"es2015": {
"loose": true,
"modules": false
}], "react"
rezwan-hossain / index.html
Last active Oct 10, 2017
Render basic html file and folder in express
View index.html
<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<h1>hello World</h1>
You can’t perform that action at this time.