Skip to content

Instantly share code, notes, and snippets.

View ahmetanbar's full-sized avatar
👨‍💻
Life is short. Let's code.

Ahmet Anbar ahmetanbar

👨‍💻
Life is short. Let's code.
View GitHub Profile
@ahmetanbar
ahmetanbar / pip.conf
Created March 27, 2024 18:15
Override pip config
[global]
index-url = https://pypi.python.org/simple
extra-index-url = https://pypi.python.org/simple
@ahmetanbar
ahmetanbar / setupvars.sh
Created August 19, 2020 09:35
openvino setupvars.sh
#!/bin/bash
# Copyright (c) 2018-2019 Intel Corporation
#
# 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
#
FROM ubuntu:18.04
USER root
WORKDIR /
ENV INSTALLDIR /opt/intel/openvino
RUN useradd -ms /bin/bash openvino && \
chown openvino -R /home/openvino
ARG DEPENDENCIES="autoconf \
automake \
@ahmetanbar
ahmetanbar / main.go
Created April 23, 2020 20:14
Golang Load Balancing code practice via: https://www.youtube.com/watch?v=QTBZxDgRZM0
package main
import (
"fmt"
"io"
"log"
"net"
)
var (
@ahmetanbar
ahmetanbar / main.php
Created March 22, 2020 00:32
Laravel Passport login by using username or email
public function findForPassport($identifier) {
return $this->orWhere('email', $identifier)->orWhere('username', $identifier)->first();
}
@ahmetanbar
ahmetanbar / beautfiy_messages_json.py
Created February 15, 2020 22:18
Parsing instagram messages archieve json data for each suspected user and showing chats clearly
import json
suspectes = [""] # forexample "anbarahmet"
json_file = "" # forexample: messages.json
with open(json_file, 'r', encoding='utf8', errors='ignore') as f:
data = json.load(f)
for user in suspectes:
for i in data:
if user in i['participants'][0] or user in i['participants'][1]:
@ahmetanbar
ahmetanbar / clear_subtitle_file.py
Created February 15, 2020 21:59
Clear "-en" string from name of subtitle file to provide autodetection subtitle file by video player for udemy course
from os import listdir, rename
from os.path import isfile, join, isdir
class Subtitle:
def __init__(self,path,lang):
self.path = path
self.lang = lang
def find_files_edit_name(self, onlyfiles, path):
for file in onlyfiles: