Skip to content

Instantly share code, notes, and snippets.

View harsha89's full-sized avatar
🎯
Focusing

Harsha Kumara harsha89

🎯
Focusing
View GitHub Profile
// Creating an Ingress resource
func createorUpdateIngressResource(r *ReconcileAPI, cr *wso2v1alpha1.API, httpPortVal int32, httpsPortVal int32,
apiBasePathMap map[string]string, controllerConfig *corev1.ConfigMap, owner []metav1.OwnerReference) error {
controlConfigData := controllerConfig.Data
transportMode := //What's the transport mode of the ingress whether http or https
ingressHostName := //Hostname to be used for the ingress
tlsSecretName := //tls secret
ingressNamePrefix := //name prefix for the ingress
ingressName := //ingress name
# Get indexes where name column has value john
indexNames = df[df['name'] == 'john'].index
# Delete these row indexes from dataFrame
df.drop(indexNames , inplace=True)
@harsha89
harsha89 / compare_dates.py
Created May 7, 2020 05:22
Compare two dates python
from datetime import datetime
def compare_dates(date):
dateFrom = datetime.strptime('01/02/2020', "%d/%m/%Y")
dateTo = datetime.strptime('30/04/2020', "%d/%m/%Y")
dateIn = datetime.strptime(date, "%Y-%m-%d")
if dateIn >= dateFrom and dateIn < dateTo:
return True
else:
import twint
import sys
c = twint.Config()
c.Search = "cancer"
c.Store_csv = True
c.User_full = True
c.Output = "tweets_cancer_intermediate.csv"
c.Resume = 'tweets_cancer_resume_intermediate.csv'
c.Since = "2020-02-23 00:00:00"
import twint
import sys
c = twint.Config()
c.Search = "cancer"
c.Store_csv = True
c.User_full = True
c.Output = "tweets_cancer_intermediate.csv"
c.Resume = 'tweets_cancer_resume_intermediate.csv'
c.Since = "2020-02-23 00:00:00"
import twint
import sys
c = twint.Config()
c.Search = "cancer"
c.Store_csv = True
c.User_full = True
c.Output = "tweets_cancer_intermediate.csv"
c.Resume = 'tweets_cancer_resume_intermediate.csv'
c.Since = "2020-02-23 00:00:00"
import twint
import sys
c = twint.Config()
c.Search = "cancer"
c.Store_csv = True
c.User_full = True
c.Output = "tweets_cancer_intermediate.csv"
c.Resume = 'tweets_cancer_resume_intermediate.csv'
c.Since = "2020-02-23 00:00:00"
import twint
import sys
c = twint.Config()
c.Search = "cancer"
c.Store_csv = True
c.User_full = True
c.Output = "tweets_cancer_intermediate.csv"
c.Resume = 'tweets_cancer_resume_intermediate.csv'
c.Since = "2020-02-23 00:00:00"
import twint
import sys
c = twint.Config()
c.Search = "cancer"
c.Store_csv = True
c.User_full = True
c.Output = "tweets_cancer_intermediate.csv"
c.Resume = 'tweets_cancer_resume_intermediate.csv'
c.Since = "2020-02-23 00:00:00"
import twint
import sys
c = twint.Config()
c.Search = "cancer"
c.Store_csv = True
c.User_full = True
c.Output = "tweets_cancer_intermediate.csv"
c.Resume = 'tweets_cancer_resume_intermediate.csv'
c.Since = "2020-02-23 00:00:00"