Skip to content

Instantly share code, notes, and snippets.

View SamaneYaghoobi's full-sized avatar
:octocat:

Samane SamaneYaghoobi

:octocat:
View GitHub Profile
@nainemom
nainemom / subtranslate.lua
Last active April 26, 2024 04:03
MPV script to translate current line of subtitle
-- Simple mpv script to translate subtitle using crow (online) or sdcv (offline) dictionaries.
-- INSTALLATION:
-- To install it, first install crow (https://crow-translate.github.io) and/or sdcv (http://dushistov.github.io/sdcv/) on your marchine with your favorite dicts and then,
-- copy this file to '~/.config/mpv/scripts/' (Linux) or '%AppData%\mpv\scripts\' (Windows).
-- sdcv help:
-- you can download offline dicts from http://download.huzheng.org/Quick/ (or anywhere else) and copy extracted dic folder to '~/.stardict/dic/'
-- CONFIGURATION:
local config = {
@hrahimi270
hrahimi270 / validateCard.js
Created January 25, 2020 14:01 — forked from mahmoud-eskandari/validateCard.js
اعتبار سنجی کارت عابر بانک ایران در جاوا اسکریپت \ Validation function of Iranian bank cards in Javascript \ تابع تشخیص صحت کارت عابربانک
"use strict";
// By Mahmoud Eskandari @ MIT license
function validateCard(card) {
if (typeof card === 'undefined'
|| card === null
|| card.length !== 16) {
return false;
}
let cardTotal = 0;
for (let i = 0; i < 16; i += 1) {
@swyxio
swyxio / 1.md
Last active February 8, 2024 22:30
Learn In Public - 7 opinions for your tech career

2019 update: this essay has been updated on my personal site, together with a followup on how to get started

2020 update: I'm now writing a book with updated versions of all these essays and 35 other chapters!!!!

1. Learn in public

If there's a golden rule, it's this one, so I put it first. All the other rules are more or less elaborations of this rule #1.

You already know that you will never be done learning. But most people "learn in private", and lurk. They consume content without creating any themselves. Again, that's fine, but we're here to talk about being in the top quintile. What you do here is to have a habit of creating learning exhaust. Write blogs and tutorials and cheatsheets. Speak at meetups and conferences. Ask and answer things on Stackoverflow or Reddit. (Avoid the walled gardens like Slack and Discourse, they're not public). Make Youtube videos

from telegram import ParseMode
from telegram.ext import Updater
import time
updater = Updater('BOT-TOKEN-ID')
chatIds = ["109416039", "109416039", "109416039", "109416039", "109416039", "109416039", "109416039", "109416039",
"109416039", "109416039", "109416039", "109416039", "109416039", "109416039", "109416039", "109416039",
"109416039", "109416039", "109416039", "109416039", "109416039", "109416039", "109416039", "109416039",
"109416039", "109416039", "109416039", "109416039", "109416039", "109416039", "109416039", "109416039",
using System;
using System.Data;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Objects;
using System.Globalization;
using System.Data.EntityClient;
using System.Data.SqlClient;
using System.Data.Common;
@ashkanRmk
ashkanRmk / remove-dotnet.sh
Created September 12, 2017 16:05
Script for remove previous version of dot net
#!/usr/bin/env bash
#
# Copyright (c) .NET Foundation and contributors. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
#
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
current_userid=$(id -u)
if [ $current_userid -ne 0 ]; then
@ashkanRmk
ashkanRmk / install-docker-linuxmint.sh
Created September 5, 2017 16:16
Make it executable and Run the Script.
#!/bin/bash
while true; do
read -p "This script will install latest Docker on your system. Continue? (Y/N)" answer
case $answer in
[Yy]* )
sudo apt-get install apt-transport-https ca-certificates -y
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
sudo echo deb https://apt.dockerproject.org/repo ubuntu-xenial main | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get purge lxc-docker
graph = {'A': ['B', 'C'],
'B': ['C', 'D'],
'C': ['D'],
'D': ['C'],
'E': ['F'],
'F': ['C']}
def find_shortest_path(graph, start, end, path=[]):
path = path + [start]
@ashkanRmk
ashkanRmk / fix_drive.sh
Created May 6, 2017 19:16
Script for fixing unmounted drive in linux
#!/bin/bash
#You can Insert line of these code for each one of your HDD Drive
#Like this: sudo ntfsfix /dev/sd[NUMBER]
sudo ntfsfix /dev/sda6
sudo ntfsfix /dev/sda5
sudo ntfsfix /dev/sda3
#If your windows has been hibernated You can't fix Drive C
@ashkanRmk
ashkanRmk / js
Created February 7, 2017 19:52
first snippest
var gulp = require('gulp'),
sass = require('gulp-sass'),
autoprefixer = require('gulp-autoprefixer'),
uglify = require('gulp-uglify'),
rename = require('gulp-rename'),
cssmin = require('gulp-cssmin'),
imagemin = require('gulp-imagemin');
gulp.task('images', function () {