Skip to content

Instantly share code, notes, and snippets.

View shantanuo's full-sized avatar

Shantanu Oak shantanuo

  • oksoft
  • mumbai
View GitHub Profile
@lizthegrey
lizthegrey / attributes.rb
Last active March 27, 2025 02:16
Hardening SSH with 2fa
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam'
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes'
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no'
@orico
orico / spacy.py
Last active April 14, 2019 08:36
Spacy GPE test
import pandas as pd
import numpy as np
import spacy
import en_core_web_sm
path_to_data = './data/'
spacy.prefer_gpu()
nlp = en_core_web_sm.load()
# -*- coding: utf-8 -*-
"""
Created on Mon Nov 12 18:19:23 2018
@author: Nhan Tran
"""
"""
y = b0 + b1*x1
y: dependent variable
import signs as signs
import pandas as pd
# load some text
df = pd.read_csv('tweets.csv').text
# load vectors
e = signs.Embeds("glove.twitter.27B.25d.txt")
# get Keras embeddings layer
#import pandas as pd
#from constants import *
#from src.commons import utils
#import matplotlib.pyplot as plt
#import numpy as np
# Read the list of all paintings (scraped data)
data = pd.read_csv('{}/data.csv'.format(DATA_FOLDER))
for year in data['year'].unique():
full_data = pd.DataFrame()
@simecek
simecek / valentine.py.R
Created February 14, 2019 21:00
R/Python Valentine Script
s = 'Python is awesome!'
red = "#FA5882"
a = eval("exec('import sys; import matplotlib.pyplot as plt; import numpy as np; print(s); t = np.arange(0,2*np.pi, 0.1); x = 16*np.sin(t)**3; y = 13*np.cos(t)-5*np.cos(2*t)-2*np.cos(3*t)-np.cos(4*t); plt.fill(x,y,color=red); plt.show(); sys.exit()')")
print('R is great too!')
X11() # Use windows() or qartz() if on Windows or Mac
t = seq(0, 2*pi, by=0.1)
x = 16*sin(t)^3
y = 13*cos(t) - 5*cos(2*t) - 2*cos(3*t) - cos(4*t)
plot(x=x, y=y, type="n", xlab="", ylab="")
polygon(x=x, y=y, col=red, border=red)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ZSalloum
ZSalloum / XOR_NeuralNetwork.py
Created January 19, 2019 01:31
Neural Network to train XOR function
import numpy as np
def sigmoid(x):
return 1.0 / (1.0 + np.exp(-x))
def sigmoid_prime(x):
return sigmoid(x) * (1.0 - sigmoid(x))
@psychemedia
psychemedia / dakar.ipynb
Last active June 23, 2019 22:37
Dakar Rally 2019 data grab
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nvbn
nvbn / add_ngrams.py
Last active January 8, 2019 08:21
Extracting popular topics from subreddits
from datetime import datetime
import json
from functools import lru_cache
from multiprocessing import Pool
import sys
from nltk.tokenize import word_tokenize, sent_tokenize
from nltk.corpus import stopwords
from nltk.util import ngrams
from nltk import WordNetLemmatizer, pos_tag