Skip to content

Instantly share code, notes, and snippets.

View alainrafiki's full-sized avatar
💭
Web Development, Data Science, and Data Analytics

Alain Rafiki alainrafiki

💭
Web Development, Data Science, and Data Analytics
View GitHub Profile
@itsmattsoria
itsmattsoria / gistfil1.textile
Last active September 27, 2025 02:49
Mac Terminal Cheat Sheet

SHORTCUTS

Key/Command Description
Tab Auto-complete files and folder names
Ctrl + A Go to the beginning of the line you are currently typing on
Ctrl + E Go to the end of the line you are currently typing on
Ctrl + U Clear the line before the cursor
Ctrl + K Clear the line after the cursor
Ctrl + W Delete the word before the cursor
Ctrl + T Swap the last two characters before the cursor
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@alainrafiki
alainrafiki / compress_s3_images.py
Created February 8, 2016 00:58 — forked from rigoneri/compress_s3_images.py
Simple python code to compress (jpeg/png) images uploaded to S3. In this use case I want to compress down all images that are over 500 KB down to 80% quality which brings the images down to about 100KB. Feel free to muck with the values.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from boto.s3.connection import S3Connection
from cStringIO import StringIO
from PIL import Image as pil
AWS_KEY = '[AWS KEY HERE]'
@hamog
hamog / laravel_deploy.md
Last active September 10, 2019 13:38
Deploy laravel 5 application on shared hosting.

Deploy Laravel 5 application on shared hosting

Server Requirements (Laravel 5.4)

  • PHP >= 5.6.4
  • OpenSSL PHP Extension
  • PDO PHP Extension
  • Mbstring PHP Extension
  • Tokenizer PHP Extension
  • XML PHP Extension
@accessnash
accessnash / predictive_analytics2.py
Created September 4, 2018 00:30
Forward stepwise variable selection for logistic regression - Chapter 2 - Predictive Analytics - Datacamp
# Import the linear_model and roc_auc_score modules
from sklearn import linear_model
from sklearn.metrics import roc_auc_score
# Consider two sets of variables
variables_1 = ["mean_gift","income_low"]
variables_2 = ["mean_gift","income_low","gender_F","country_India","age"]
# Make predictions using the first set of variables and assign the AUC to auc_1
X_1 = basetable[variables_1]
import pandas as pd
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import seaborn as sns
import missingno
import warnings
warnings.filterwarnings("ignore")
%matplotlib inline
@fomightez
fomightez / Adjusting Figure Caption Text Position.ipynb
Created February 7, 2020 19:40
Adjusting Figure Caption Text Position
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@audhiaprilliant
audhiaprilliant / kprototype.ipynb
Last active April 13, 2023 16:37
Clustering Algorithm for Mixed Data Type
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aspose-com-gists
aspose-com-gists / convert-excel-to-image.py
Last active August 29, 2024 11:10
Excel to Image in Python
# load the Excel workbook
workbook = Workbook("Book1.xlsx")
# create image options
imgOptions = ImageOrPrintOptions()
imgOptions.setSaveFormat(SaveFormat.SVG)
# load the worksheet to be rendered
sheet = workbook.getWorksheets().get(0)