Skip to content

Instantly share code, notes, and snippets.

View rezwan-hossain's full-sized avatar

Rezwan Hossain rezwan-hossain

View GitHub Profile
const redux = require("redux");
const createStore = redux.createStore;
const initialState = {
counter: 0,
};
//reducer
const reducer = (state = initialState, action) => {
@rezwan-hossain
rezwan-hossain / Borders bookmarklet
Created November 7, 2020 03:35 — forked from ikenfin/Borders bookmarklet
Bookmarklet to show borders for divs
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
rezwan-hossain / gist:8f9dbabca6716ee09b8e474ecec0b818
Last active April 30, 2020 10:21
Shortcut to switch displays focus and cursor on ubuntu
install:
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 ./focus_changer.py left
@rezwan-hossain
rezwan-hossain / gist:f8a10b2bbb3321ae202ddf6262d83415
Last active May 15, 2023 20:36
rofi keybinding/shortcut for starting rofi
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">
// 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
rezwan-hossain / path.js
Created September 21, 2017 20:22 — forked from creationix/path.js
Simple path join and dirname functions for generic javascript
// 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
rezwan-hossain / README.md
Created September 15, 2017 18:24 — forked from joyrexus/README.md
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@rezwan-hossain
rezwan-hossain / gist:431df2fba1d33cecc01bbf3ca8d80b24
Last active August 6, 2017 20:27
PostgreSQL and pgAdmin setup
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
rezwan-hossain / git_add_remove.txt
Last active August 3, 2017 10:51
Remove node_module form git add or git repo
git rm -r --cached node_modules
git commit -m ':) ;)'
git push origin master
@rezwan-hossain
rezwan-hossain / .babelrc
Created May 25, 2017 19:20 — forked from JamieMason/.babelrc
Tree-Shaking with Babel 6, Webpack 2, and React.
{
"presets": [
["es2015", {
"es2015": {
"loose": true,
"modules": false
}
}], "react"
]
}