Skip to content

Instantly share code, notes, and snippets.

View moeinrahimi's full-sized avatar
💪

Moein Rahimi moeinrahimi

💪
View GitHub Profile
@ddomen
ddomen / npm_windows_fix.js
Last active January 25, 2024 13:57
File for fix npm windows problems (related to error Unexpected token '.' when trying to run 'npm install')
/**
* Copyright (c) 2022 ddomen (Daniele Domenichelli <daniele.domenichelli.5@gmail.com>)
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
@ahbanavi
ahbanavi / check_sub.sh
Last active December 18, 2021 16:08
Check if subtitle released in subscene
#!/bin/bash
SUB=$(curl --silent https://subscene.com/subtitles/only-murders-in-the-building-first-season/farsi_persian --proxy $proxyip:10808)
if [[ $SUB == *"S01E05"* ]]; then
echo "found!"
# spd-say "subtitle found!" # apt-get install speech-dispatcher
curl --silent https://api.telegram.org/botBOT_TOKEN/sendMessage\?chat_id\=YOUR_USER_ID\&text\=Subtitle%20Found\! --proxy $proxyip:10808
exit 1
else
@bradtraversy
bradtraversy / eslint_prettier_airbnb.md
Created July 19, 2019 17:54
ESLint, Prettier & Airbnb Setup

VSCode - ESLint, Prettier & Airbnb Setup

1. Install ESLint & Prettier extensions for VSCode

Optional - Set format on save and any global prettier options

2. Install Packages

npm i -D eslint prettier eslint-plugin-prettier eslint-config-prettier eslint-plugin-node eslint-config-node
@bradtraversy
bradtraversy / docker-help.md
Last active May 4, 2024 14:32
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info

@wesbos
wesbos / async-await.js
Created February 22, 2017 14:02
Simple Async/Await Example
// 🔥 Node 7.6 has async/await! Here is a quick run down on how async/await works
const axios = require('axios'); // promised based requests - like fetch()
function getCoffee() {
return new Promise(resolve => {
setTimeout(() => resolve('☕'), 2000); // it takes 2 seconds to make coffee
});
}
@Rich-Harris
Rich-Harris / service-workers.md
Last active April 21, 2024 16:24
Stuff I wish I'd known sooner about service workers

Stuff I wish I'd known sooner about service workers

I recently had several days of extremely frustrating experiences with service workers. Here are a few things I've since learned which would have made my life much easier but which isn't particularly obvious from most of the blog posts and videos I've seen.

I'll add to this list over time – suggested additions welcome in the comments or via twitter.com/rich_harris.

Use Canary for development instead of Chrome stable

Chrome 51 has some pretty wild behaviour related to console.log in service workers. Canary doesn't, and it has a load of really good service worker related stuff in devtools.

@subfuzion
subfuzion / curl.md
Last active May 3, 2024 09:26
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@vasanthk
vasanthk / System Design.md
Last active May 5, 2024 09:57
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@claudiosanches
claudiosanches / install.sh
Last active September 3, 2021 15:48
Ubuntu - Install Strem.io
#!/usr/bin/env bash
sudo su
curl -SO# http://178.62.254.47/Stremio3.5.1.linux.tar.gz
mkdir -p /opt/stremio
tar -xvzf Stremio3.5.1.linux.tar.gz -C /opt/stremio
curl -SO# http://www.strem.io/3.0/stremio-white-small.png
mv stremio-white-small.png /opt/stremio/
curl -SO# https://gist.githubusercontent.com/claudiosmweb/797b502bc095dabee606/raw/52ad06b73d90a4ef389a384fbc815066c89798eb/stremio.desktop
mv stremio.desktop /usr/share/applications/