Skip to content

Instantly share code, notes, and snippets.

View RaminMammadzada's full-sized avatar
🔬
Engineering is a wonderful thing if one does not have to earn one's living at it

Ramin RaminMammadzada

🔬
Engineering is a wonderful thing if one does not have to earn one's living at it
View GitHub Profile
@RaminMammadzada
RaminMammadzada / SettingsActivity - NewsApp
Created June 12, 2018 22:40
NewsApp - SettingsActivity
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@RaminMammadzada
RaminMammadzada / Projects for image recognition
Last active December 9, 2018 21:03
Open source applications in the image recognition field, especially for product selection in markets
1) Pastec is an open source index and search engine for image recognition based on OpenCV.
https://github.com/magwyz/pastec
2) Shoe recognition app with flask backend.
https://github.com/aedorado/fls-shoe-app
3) UT Zappos50K (UT-Zap50K) is a large shoe dataset consisting of 50,025 catalog images collected from Zappos.com
http://vision.cs.utexas.edu/projects/finegrained/utzap50k/
@RaminMammadzada
RaminMammadzada / Clone all repos at once
Last active December 26, 2018 20:23
Script to clone all of the repos at once
Script:
curl -s https://api.github.com/users/user/repos | grep \"clone_url\" | awk '{print $2}' | sed -e 's/"//g' -e 's/,//g' | xargs -n1 git clone
More info:
https://blog.scottlowe.org/2018/07/19/cloning-all-repositories-in-a-github-organization/
@RaminMammadzada
RaminMammadzada / Neural Network App on Music Industry
Created January 2, 2019 19:25
Neural Network App on Music Industry
1) Piano Genie article
https://arxiv.org/abs/1810.05246
2) Neural Translation of Musical Style
https://arxiv.org/abs/1708.03535
3) Google’s AI-powered Piano Genie lets anyone improvise perfectly by bashing buttons
https://www.theverge.com/2018/10/16/17982596/google-magenta-ai-piano-genie-improvisation-neural-networks
4) Piano Genie: An Intelligent Musical Interface
@RaminMammadzada
RaminMammadzada / Ceaser Cipher in Python
Last active April 12, 2020 06:48
Ceaser Cipher in Python
"""
Implement Caesar’s cipher: implement a function encrypt that
given a plaintext string and a key 𝑘 (how many letters to shift),
returns a ciphertext where each character is shifted 𝑘 places.
(You can assume all characters are lowercase letters, with no punctuation or spaces.)
"""
alphabet = 'abcdefghijklmnopqrstuvwxyz'
def encrypt(plaintext="hithere", k=4):
@RaminMammadzada
RaminMammadzada / Timing Attack for 4 digits password
Created April 12, 2020 06:47
Timing Attack for 4 digits password
"""
The function check_password(password) is used by a safe with 4-digits passwords, and is
susceptible to timing attacks. More specifically, it takes it around 0.1 seconds to check
one digit – so brute-forcing all the possible combinations will take around 1,500 hours.
Can you implement a way to crack its password in less than a minute?
"""
import time
import sys # ignore
"""
Brute-force the following Caesar’s cipher, and find
the plaintext and key of the following
message: kyvtrmrcipnzccrkkrtbwifdkyvefikynvjkrkeffe
"""
alphabet = "abcdefghijklmnopqrstuvwxyz"
def encrypt(plaintext, k):
ciphertext = []
@RaminMammadzada
RaminMammadzada / Letter Frequency Finder
Created April 12, 2020 07:42
The frequencies of the letter in the text
"""
The following English text was encrypted using a substitution cipher that shuffles the alphabet rather than just shifting it.
Can you find what the following letters l and h stand for in the following text ?
hm al, mo tmh hm al, huvh gn hul jzlnhgmt:
qulhulo 'hgn tmaxlo gt hul cgty hm nzrrlo
hul nxgtsn vty voomqn mr mzhovslmzn rmohztl,
mo hm hvel vocn vsvgtnh v nlv mr homzaxln
vty ak mppmngts lty hulc?
hm ygl: hm nxllp;
@RaminMammadzada
RaminMammadzada / Creating a repository from command line
Created July 6, 2020 05:18
Creating a repository from command line
mkdir myDirName #this is the name of your directory
cd /myDirName
git init
touch readME.md #this is to create an initial file to push
git commit -m "enter commit message here"
git remote add origin git@github.com:YOUR_USERNAME/myDirName.git
curl -u USERNAME:PASSWORD https://api.github.com/user/repos -d '{"name":"myDirName"}' #this will create the repo in github.
# if you haven't generated and SSH key for github access then follow these steps, otherwise you're good to push your shit to github.
@RaminMammadzada
RaminMammadzada / homebrew-permissions-issue.md
Created August 8, 2020 15:18 — forked from irazasyed/homebrew-permissions-issue.md
Homebrew: Permissions Denied Issue Fix (OS X / macOS)

Homebrew Permissions Denied Issues Solution

sudo chown -R $(whoami) $(brew --prefix)/*