Skip to content

Instantly share code, notes, and snippets.

View alinasrullayev's full-sized avatar

Ali Nasrullayev alinasrullayev

  • Azeribaijan/Baku
View GitHub Profile
alinasrullayev /
Created March 7, 2021 14:32 — forked from dave-andersen/
k-means in Tensorflow
import tensorflow as tf
import numpy as np
import time
MAX_ITERS = 1000
start = time.time()
alinasrullayev / lang.js
Created March 8, 2021 12:47 — forked from mirontoli/lang.js
Get Language name based on iso 639-1 code
* @author Anatoly Mironov (mirontoli)
* using Phil Teare's answer on stackoverflow
alinasrullayev /
Created July 7, 2021 20:48 — forked from MaxHalford/
Keras fit/predict scikit-learn pipeline
import os
from keras import backend as K
from keras import callbacks
from keras import layers
from keras import models
from keras.wrappers.scikit_learn import KerasClassifier
import pandas as pd
import tensorflow as tf
from sklearn import metrics
alinasrullayev /
Created August 17, 2021 18:17 — forked from subfuzion/
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.

alinasrullayev /
Created August 29, 2021 19:00 — forked from ygotthilf/
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out
cat jwtRS256.key
alinasrullayev /
Created September 10, 2021 16:36 — forked from hirobert/
flask abort as json
from flask import abort, make_response, jsonify
abort(make_response(jsonify(message="Message goes here"), 400))
alinasrullayev /
Created May 1, 2022 12:39 — forked from kirang89/
Example for many-to-many relationship with extra columns in SQLAlchemy
import sqlalchemy
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Integer, String, ForeignKey
from sqlalchemy.orm import sessionmaker, relationship
engine = sqlalchemy.create_engine('sqlite:///:memory:')
Base = declarative_base()
Windows 8 Preinstall Keys
Windows 8
Windows 8 Professional
alinasrullayev /
Created July 1, 2022 11:08 — forked from stefanthoss/
Export/import a PySpark schema to/from a JSON file
import json
from pyspark.sql.types import *
# Define the schema
schema = StructType(
[StructField("name", StringType(), True), StructField("age", IntegerType(), True)]
# Write the schema
with open("schema.json", "w") as f:
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.