Skip to content

Instantly share code, notes, and snippets.

View SamaneYaghoobi's full-sized avatar
:octocat:

Samane SamaneYaghoobi

:octocat:
View GitHub Profile
#!/bin/bash
time for x in */img*.jpg; do
out=`dirname $x`/4`basename $x`
if test -f $out; then
echo Skipping $x
else
echo $x
time convert -geometry 25% \
-pointsize 36 -fill white \
@aidin36
aidin36 / rename-by-date.py
Last active July 18, 2020 14:16
Renames JPEG files to the date and time it's taken.
# This work is published under CC0 (https://creativecommons.org/publicdomain/zero/1.0/)
# To the extent possible under law, Aidin Gharibnavaz (http://www.aidinhut.com) has waived
# all copyright and related or neighboring rights to this work.
import sys
import os
try:
import exifread
except ImportError:
@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 () {
@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
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 / 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
@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
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;
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",
@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