Skip to content

Instantly share code, notes, and snippets.

View rmuratov's full-sized avatar

Ramil Muratov rmuratov

View GitHub Profile
@phatnguyenuit
phatnguyenuit / how-to-sort-imports-like-a-pro.md
Last active March 11, 2025 07:17
How to sort imports like a pro in TypeScript

How to sort imports like a pro in TypeScript

Crossing reviews becomes a very common activity today in engineering behavior. To help us review changes for pull/merge requests easier, sorting imports can help us a much. The codebase becomes more professional and more consistent, reviewers will be happier, and the review process will be faster, focusing on the implementation changes ONLY.

Have you ever thought about how to sort imports in TypeScript projects automatically?

Let me show you how to archive sorting imports automatically in TypeScript projects with ESLint!

@tomhicks
tomhicks / plink-plonk.js
Last active November 12, 2024 19:08
Listen to your web pages
@acdha
acdha / simple_cors_server.py
Last active March 22, 2025 19:47
Python 3: serve the current directory as HTTP while setting CORS headers for XHR debugging
#!/usr/bin/env python3
# encoding: utf-8
"""Use instead of `python3 -m http.server` when you need CORS"""
from http.server import HTTPServer, SimpleHTTPRequestHandler
class CORSRequestHandler(SimpleHTTPRequestHandler):
def end_headers(self):
self.send_header('Access-Control-Allow-Origin', '*')
@vovka
vovka / gist:6806363
Last active December 28, 2016 11:38
VK auto liker
var h=document.getElementsByClassName('post_like_icon'),u=[],i;for(i=0;i<h.length;i++){if(!h[i].className.match('my_like'))u.push(h[i])};console.log('unliked amount '+u.length);i=-1;function l(){i++;if(i<u.length){u[i].click();console.log('liked'+u[i]);setTimeout(l,1000)}};l()
@willurd
willurd / web-servers.md
Last active May 10, 2025 14:01
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@nicoespeon
nicoespeon / compressor.rb
Last active March 20, 2025 09:04 — forked from mytharcher/compressor.rb
A jekyll plugin for compressing HTML, JavaScript files when rendering.
#
# File compressor plugin for jekyll
# =================================
#
# By [mytharcher](https://github.com/mytharcher)
# 2012-05-20
#
# Updated by [nicoespeon](https://github.com/nicoespeon)
# 2013-04-12
#

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@bartoszmajsak
bartoszmajsak / prepare-commit-msg.sh
Last active January 22, 2025 09:31
How to automatically prepend git commit with a branch name
#!/bin/bash
# This way you can customize which branches should be skipped when
# prepending commit message.
if [ -z "$BRANCHES_TO_SKIP" ]; then
BRANCHES_TO_SKIP=(master develop test)
fi
BRANCH_NAME=$(git symbolic-ref --short HEAD)
BRANCH_NAME="${BRANCH_NAME##*/}"
@swaroopch
swaroopch / flask-boilerplate-tmux.bash
Created December 5, 2010 07:00
A command that scripts a tmux session
#!/bin/bash
function flask-boilerplate-tmux
{
# https://github.com/swaroopch/flask-boilerplate
BASE="$HOME/code/flask-boilerplate"
cd $BASE
tmux start-server
tmux new-session -d -s flaskboilerplate -n model