Skip to content

Instantly share code, notes, and snippets.

View ramesaliyev's full-sized avatar
🏇
Learn, Do, Sleep, Repeat.

Rameş Aliyev ramesaliyev

🏇
Learn, Do, Sleep, Repeat.
View GitHub Profile
@ramesaliyev
ramesaliyev / howto.md
Last active May 6, 2024 16:23
Syncing a Forked Repo

Syncing a Forked Repo

The Setup

Before you can sync, you need to add a remote that points to the upstream repository. You may have done this when you originally forked.

$ git remote -v
# List the current remotes
origin  https://github.com/user/repo.git (fetch)

origin https://github.com/user/repo.git (push)

var net = require("net");
process.stdin.setEncoding('utf-8');
var connection = net.connect(10000, "192.168.137.1", function() { // connect to the server we made
console.log("client connected");
// When receive user input data in console.
process.stdin.on('data', function (message) {
// If user do not input data in command line then send default message.
@ramesaliyev
ramesaliyev / client.js
Created May 20, 2022 15:10
udp-broadcast
// Require node js dgram module.
var dgram = require('dgram');
// Create a udp socket client object.
var client = dgram.createSocket("udp4");
// message variable is used to save user input text.
var message = "";
// Set command line input character encoding to utf-8.
@ramesaliyev
ramesaliyev / yeter.js
Last active October 28, 2020 10:04
[YETER] When everything starts bothering you, yeter is yeter.
// When everything starts bothering you, yeter is yeter.
// to contribute
// https://gist.github.com/ramesaliyev/13a710f602cfb922d05bef940be3ac31
// to use
// https://kes.im/yeterjs
// in html:
// <script src="https://kes.im/yeterjs"></script>
@ramesaliyev
ramesaliyev / wikiwand-print.js
Last active September 22, 2019 08:18
Wikiwand remove everything other than content
const rmel = selector => {
try {
for (el of document.querySelectorAll(selector)) {
el.parentElement.removeChild(el);
}
} catch (e) {
}
}
const gel = selector => (
@ramesaliyev
ramesaliyev / USING-DIFFMERGE.md
Last active November 14, 2020 20:16 — forked from smoll/USING-DIFFMERGE.md
Using DiffMerge as your git mergetool (for Mac OS X / macOS)
@ramesaliyev
ramesaliyev / kilp.sh
Created August 25, 2018 07:24
Kill process listening on port
# Simply Add this into your .bashrc or .zshrc or something.
# Reload bash and then;
# kilp 7070
function kilp() {
kill -9 $(lsof -ti tcp:$1)
}
@ramesaliyev
ramesaliyev / docker-purge-everything.sh
Created August 23, 2018 13:43
Remove everything from docker.
# This will;
# - stop every container
# - remove every container
# - remove every image
# - remove every network
# - remove every volume
$(docker stop -f $(docker ps -aq)) /
$(docker rm -f $(docker ps -aq)) /
$(docker rmi -f $(docker images -aq)) /
@ramesaliyev
ramesaliyev / bash_renamer.sh
Created May 28, 2018 10:20
Simple scripts for rename bulk files with bash.
for file in ADA202_*.pdf
do
mv "$file" "${file/ADA202_/}"
done
@ramesaliyev
ramesaliyev / react-lifecycle.js
Created March 29, 2017 10:41
React.js Lifecycle Events
// Invoked once before first render
componentWillMount() {
console.log('componentWillMount');
// Calling setState here does not cause a re-render
}
// Invoked once after the first render
componentDidMount(){
console.log('componentDidMount');
}