Skip to content

Instantly share code, notes, and snippets.

View Shuyib's full-sized avatar
🐯
Focusing

Megabyte Shuyib

🐯
Focusing
View GitHub Profile
@Shuyib
Shuyib / sh
Last active November 6, 2023 09:10
Convert mp3 to wav with ffmpeg
#!/bin/bash
# install ffmpeg if not already installed
if ! command -v ffmpeg &> /dev/null
then
echo "ffmpeg could not be found"
echo "Installing ffmpeg..."
sudo apt-get install ffmpeg
fi
@Shuyib
Shuyib / Makefile
Last active April 1, 2024 07:12
Data science and Machine learning Makefile for Python projects or in general :)
# Thank you @Earthly https://www.youtube.com/watch?v=w2UeLF7EEwk
# Can be adapted to pipenv, and poetry
# Other languages coming soon especially R and Julia
# .ONESHELL tells make to run each recipe line in a single shell
.ONESHELL:
# .DEFAULT_GOAL tells make which target to run when no target is specified
.DEFAULT_GOAL := all
@Shuyib
Shuyib / Makefile
Created August 24, 2022 08:45 — forked from geraldgong/Makefile
SHELL := /usr/bin/env bash
#######
# Help
#######
.DEFAULT_GOAL := help
.PHONY: help
help:
@Shuyib
Shuyib / .bash_profile
Created September 30, 2020 05:02 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@Shuyib
Shuyib / r-to-python-data-wrangling-basics.md
Created October 2, 2019 06:18 — forked from conormm/r-to-python-data-wrangling-basics.md
R to Python: Data wrangling with dplyr and pandas

R to python data wrangling snippets

The dplyr package in R makes data wrangling significantly easier. The beauty of dplyr is that, by design, the options available are limited. Specifically, a set of key verbs form the core of the package. Using these verbs you can solve a wide range of data problems effectively in a shorter timeframe. Whilse transitioning to Python I have greatly missed the ease with which I can think through and solve problems using dplyr in R. The purpose of this document is to demonstrate how to execute the key dplyr verbs when manipulating data using Python (with the pandas package).

dplyr is organised around six key verbs:

@Shuyib
Shuyib / east&southernafricamosquitoes.ipynb
Last active October 30, 2018 20:33 — forked from itsmuriuki/east&southernafricamosquitoes.ipynb
East and South African Mosquito classifier: This notebook has images of mosquitoes of three species which are prevalent in the areas mentioned and could be carriers of the parasite Plasmodium in their salivary glands which is the causative agent of malaria.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Shuyib
Shuyib / r_ubuntu_17_10.sh
Created March 7, 2018 07:11 — forked from pachadotdev/r_ubuntu_17_10.sh
Install R on Ubuntu 17.10
# Install R
sudo apt-get update
sudo apt-get install gdebi libxml2-dev libssl-dev libcurl4-openssl-dev libopenblas-dev r-base r-base-dev
# Install RStudio
cd ~/Downloads
wget https://download1.rstudio.org/rstudio-xenial-1.1.383-amd64.deb
sudo gdebi rstudio-xenial-1.1.383-amd64.deb
printf '\nexport QT_STYLE_OVERRIDE=gtk\n' | sudo tee -a ~/.profile
@Shuyib
Shuyib / tweet_listener.py
Created January 19, 2017 06:48 — forked from hugobowne/tweet_listener.py
Here I define a Tweet listener that creates a file called 'tweets.txt', collects streaming tweets as .jsons and writes them to the file 'tweets.txt'; once 100 tweets have been streamed, the listener closes the file and stops listening.
class MyStreamListener(tweepy.StreamListener):
def __init__(self, api=None):
super(MyStreamListener, self).__init__()
self.num_tweets = 0
self.file = open("tweets.txt", "w")
def on_status(self, status):
tweet = status._json
self.file.write( json.dumps(tweet) + '\n' )
self.num_tweets += 1
@Shuyib
Shuyib / earned_badges.sql
Last active May 19, 2018 19:32 — forked from pamelafox/earned_badges.sql
earned_badges.sql
/*
Earned Badges
This table contains badges earned by a user, including the most recent date achieved, the type, the name, the # of energy points earned, and the activity earned from.
Collected by: https://www.khanacademy.org/profile/chopsor/
*/
CREATE TABLE badges (
date TEXT,
badge_type TEXT,
badge_name TEXT,