Skip to content

Instantly share code, notes, and snippets.

@mabdrabo
mabdrabo / background.jpg
Last active August 29, 2015 14:09
Simple Parallax
background.jpg
@mabdrabo
mabdrabo / OCR.m
Created May 28, 2014 21:26
Number plate recognition
clc, clear, close all
for i=1:6
x = imread(strcat(num2str(i), '.jpg'));
% x= imread('2.jpg'); % read image
image = rgb2gray(x);
%g=medfilt2(image,[2 2]); % Median filtering to remove noise.
H = padarray(2,[2 2]) - fspecial('gaussian' ,[5 5],2); % create unsharp mask
sharpened = imfilter(image,H); % create a sharpened version of the image using that mask
BW2 = edge(sharpened,'prewitt');
@mabdrabo
mabdrabo / AudioContextMonkeyPatch.js
Last active August 29, 2015 13:56
a javascript module to record sound from the microphone, and save it.
/* Copyright 2013 Chris Wilson
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
@mabdrabo
mabdrabo / sound_recorder.py
Created January 28, 2014 23:05
Simple script to record sound from the microphone, dependencies: easy_install pyaudio
import pyaudio
import wave
FORMAT = pyaudio.paInt16
CHANNELS = 2
RATE = 44100
CHUNK = 1024
RECORD_SECONDS = 5
WAVE_OUTPUT_FILENAME = "file.wav"
@mabdrabo
mabdrabo / manage.py
Created January 14, 2014 21:57 — forked from bennylope/LICENSE
#!/usr/bin/env python
import os
import sys
import re
def read_env():
"""Pulled from Honcho code with minor updates, reads local default
environment variables from a .env file located in the project root
directory.
@mabdrabo
mabdrabo / example.py
Last active May 1, 2017 17:48
bash script that installs Sphinxbase, Pocketsphinx, Gstreamer, and plugins needed for Gstreamer to work with Pocketsphinx and example.py file containing a simple example code.
#!/usr/bin/env python
# Copyright (c) 2008 Carnegie Mellon University.
#
# You may modify and redistribute this file under the same terms as
# the CMU Sphinx system. See
# http://cmusphinx.sourceforge.net/html/LICENSE for more information.
# Edited by: Mahmoud Abdrabo on Wed Dec 25 2013
# Something in lines of http://stackoverflow.com/questions/348630/how-can-i-download-all-emails-with-attachments-from-gmail
# Make sure you have IMAP enabled in your gmail settings.
# Right now it won't download same file name twice even if their contents are different.
import email
import getpass, imaplib
import os
import sys
detach_dir = '.'
@mabdrabo
mabdrabo / DC_motor_calculator.html
Last active December 29, 2020 08:21
given a few basic info about the robot or vehicle, gives an approximate to what is really needed.
<!DOCTYPE html>
<html>
<head>
<title>DC motor calculator</title>
<script>
function calculate () {
mass = document.getElementById('mass').value;
acceleration = document.getElementById('acceleration').value;
speed = document.getElementById('speed').value;
@mabdrabo
mabdrabo / pip-Git-Django starter (Ubuntu)
Last active December 18, 2015 23:59
Bash script to fast forward installation of a basic Django environment. for Ubuntu.
#!/bin/bash
#Author: Mahmoud Abdrabo
#Date: 2012 Sat Aug 4, 3:06:45
clear
echo "Do you want to install missing stuff? (y,n)"
read installation
if [ "$installation" = "y" ]; then