Skip to content

Instantly share code, notes, and snippets.

View muokicaleb's full-sized avatar
🎯
Focusing

Muoki Caleb muokicaleb

🎯
Focusing
View GitHub Profile

1. Clone your fork:

git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@muokicaleb
muokicaleb / autocommit.sh
Created July 9, 2019 11:43
A script to auto commit code.
# a script that automatically commits when the file is saved
# you need to install inotify-tools
inotifywait -q -m -e CLOSE_WRITE --format="git commit -m 'autocommit ' %w" *.* | sh
git clone https://github.com/fastai/fastai
cd fastai
conda create -n fastai python=3.6 anaconda
conda env update
activate fastai
i
'''
Make the assumption that weight value is missing in the df but
Looking at the columns we'll notice that there is Item_Identifier. Similar items have the same identifier.
We can have a dictionary of the weigts and identifier. Then look up the missing values for each.
'''
# first create a pivot table
item_avg_weight = df.pivot_table(values='Item_Weight', index='Item_Identifier')
'''
# get sum of all unique values in all columns
df.apply(lambda x: len(x.unique()))
# SUm null values
df.isnull().sum()
#apply to rows based on a row
df['Name_entity'] = df.apply (lambda df: name_entity_recognition(df['clean_tweet']), axis=1)
@muokicaleb
muokicaleb / nginx.conf
Created August 7, 2020 13:16 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@muokicaleb
muokicaleb / tweet_dumper.py
Created November 2, 2020 08:42 — forked from yanofsky/LICENSE
A script to download all of a user's tweets into a csv
#!/usr/bin/env python
# encoding: utf-8
import tweepy #https://github.com/tweepy/tweepy
import csv
#Twitter API credentials
consumer_key = ""
consumer_secret = ""
access_key = ""
basic_auth_users:
prometheus: $2y$12$UR3iyrDxfWsahCIg0ikKquNBjV3xwdoJZiuz.vhHgpvQrjLhmqmE6s
version: '3.7'
services:
node_exporter:
image: quay.io/prometheus/node-exporter:latest
command:
- '--path.rootfs=/host'
network_mode: host
pid: host
restart: unless-stopped
version: '3.7'
services:
node_exporter:
image: quay.io/prometheus/node-exporter:latest
command:
- '--path.rootfs=/host'
- '--web.config=/node_exporter_conf.yaml'
network_mode: host
pid: host