Skip to content

Instantly share code, notes, and snippets.

View umayrh's full-sized avatar

Umayr Hassan umayrh

View GitHub Profile
@xirixiz
xirixiz / Set up GitHub push with SSH keys.md
Last active July 7, 2026 08:51 — forked from developius/README.md
Set up GitHub push with SSH keys

SSH keypair setup for GitHub (or GitHub/GitLab/BitBucket, etc, etc)

Create a repo.

Make sure there is at least one file in it (even just the README.md)

Generate a SSH key pair (private/public):

ssh-keygen -t rsa -C "your_email@example.com"
@didacroyo
didacroyo / ftInceptionV3.py
Last active April 21, 2024 11:44
InceptionV3 Fine Tuning with Keras
# from the guide https://blog.keras.io/building-powerful-image-classification-models-using-very-little-data.html
# and from other resources found, trying to achieve a good classifier based on Inveption V3 pre-trained netfork
from keras.applications.inception_v3 import InceptionV3
from keras.preprocessing import image
from keras.models import Model
from keras.layers import Dense, GlobalAveragePooling2D
from keras.preprocessing.image import ImageDataGenerator
from keras import backend as K
from keras.callbacks import ModelCheckpoint
@haircut
haircut / Install PIP to user site on macOS.md
Created August 29, 2017 21:50
How to install and use pip without sudo or admin on macOS

Install and use pip on macOS without sudo / admin access

Most recently tested on macOS Sierra (10.12.6)

  1. Download the installation script; curl https://bootstrap.pypa.io/get-pip.py -o ~/Downloads/get-pip.py
  2. Run the installation, appending the --user flag; python ~/Downloads/get-pip.py --user. pip will be installed to ~/Library/Python/2.7/bin/pip
  3. Make sure ~/Library/Python/2.7/bin is in your $PATH. For bash users, edit the PATH= line in ~/.bashrc to append the local Python path; ie. PATH=$PATH:~/Library/Python/2.7/bin. Apply the changes, source ~/.bashrc.
  4. Use pip! Remember to append --user when installing modules; ie. pip install <package_name> --user

Note

@danielfennelly
danielfennelly / app.py
Created March 18, 2017 23:16
Minimal Flask-login example
import flask
import flask_login
app = flask.Flask(__name__)
app.secret_key = 'super secret string' # Change this!
login_manager = flask_login.LoginManager()
login_manager.init_app(app)
# Our mock database.
@tzmartin
tzmartin / m3u8-to-mp4.md
Last active June 20, 2026 16:20
m3u8 stream to mp4 using ffmpeg

1. Copy m3u8 link

Alt text

2. Run command

echo "Enter m3u8 link:";read link;echo "Enter output filename:";read filename;ffmpeg -i "$link" -bsf:a aac_adtstoasc -vcodec copy -c copy -crf 50 $filename.mp4
@eguven
eguven / brew-list.sh
Last active July 26, 2026 13:53
List all packages installed using Homebrew and their sizes
# this original one uses values returned from 'brew info'
brew list --formula | xargs -n1 -P8 -I {} \
sh -c "brew info {} | egrep '[0-9]* files, ' | sed 's/^.*[0-9]* files, \(.*\)).*$/{} \1/'" | \
sort -h -r -k2 - | column -t
# faster alternative using 'du'
du -sch $(brew --cellar)/*/* | sed "s|$(brew --cellar)/\([^/]*\)/.*|\1|" | sort -k1h
@tzmartin
tzmartin / embedded-file-viewer.md
Last active June 29, 2026 19:42
Embedded File Viewer: Google Drive, OneDrive

Office Web Apps Viewer

('.ppt' '.pptx' '.doc', '.docx', '.xls', '.xlsx')

http://view.officeapps.live.com/op/view.aspx?src=[OFFICE_FILE_URL]

<iframe src='https://view.officeapps.live.com/op/embed.aspx?src=[OFFICE_FILE_URL]' width='px' height='px' frameborder='0'>
</iframe>

OneDrive Embed Links

@DaniSancas
DaniSancas / neo4j_cypher_cheatsheet.md
Created June 14, 2016 23:52
Neo4j's Cypher queries cheatsheet

Neo4j Tutorial

Fundamentals

Store any kind of data using the following graph concepts:

  • Node: Graph data records
  • Relationship: Connect nodes (has direction and a type)
  • Property: Stores data in key-value pair in nodes and relationships
  • Label: Groups nodes and relationships (optional)
@jamescarr
jamescarr / shell.py
Last active July 22, 2025 01:09
Test jinja2 out in a console quickly. If you have jinja2 installed locally just open a python REPL and do this!
from jinja2 import Template
text = """
hi {{ name|default(other_name) }}
"""
template = Template(text)
template.render(name="foo") # passing variables here to the text template if needed
template.render(other_name="bar")
@SanMuHe
SanMuHe / first_day_of_week.py
Created December 30, 2015 05:59
Python: Given a date, get the first day of its corresponding week
# -*- coding: utf-8 -*-
import datetime
def first_day_of_week(date):
return date + datetime.timedelta(days = -date.weekday())