Skip to content

Instantly share code, notes, and snippets.

View damzaky's full-sized avatar
LGTM enjoyer

damar Zaky damzaky

LGTM enjoyer
View GitHub Profile
prediction = classifier.predict(vectorizer.transform([input('enter input: ')]).toarray())
print('positive' if prediction[0] == 1 else 'negative')
classifier = naive_bayes.MultinomialNB()
classifier.fit(X,y)
X = data['text']
y = data['label']
vectorizer = CountVectorizer()
vectorizer.fit(X)
X = vectorizer.transform(X).toarray()
import pandas as pd
from sklearn.feature_extraction.text import CountVectorizer
from sklearn import naive_bayes
data = pd.read_csv("imdb2k.csv")
@damzaky
damzaky / downloadImgurGifvAsMp4.js
Last active May 5, 2018 17:31
How to download Imgur GIFV as MP4. Just copy paste this script to the console (CTRL+SHIFT+J on Chrome, CTRL+SHIFT+K on Firefox) and then press enter.
var q = document.createElement('a');
q.href = document.querySelector('source').src;
q.download = document.title;
q.click();
@damzaky
damzaky / Undocumented-api-social-media.md
Last active March 10, 2018 01:08
Undocumented API of some social media/forum that don't require authentication
  • Instagram: https://www.instagram.com/username/?__a=1
  • Twitter: https://twitter.com/i/profiles/show/username/timeline/tweets
  • Reddit: https://www.reddit.com/.json or https://www.reddit.com/r/subreddit.json
[
"alder",
"black alder",
"common alder",
"false alder",
"gray alder",
"speckled alder",
"striped alder",
"white alder",
"almond",
@damzaky
damzaky / animaux.json
Last active February 18, 2018 04:00
Array of animals
[
"aardvark",
"aardwolf",
"african buffalo",
"african elephant",
"african leopard",
"african wild dog",
"albatross",
"alligator",
"alpaca",