Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

ehza ehzawad

🎯
Focusing
View GitHub Profile
@ehzawad
ehzawad / min-char-rnn.py
Created Aug 23, 2020 — forked from karpathy/min-char-rnn.py
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
View min-char-rnn.py
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
@ehzawad
ehzawad / docker-help.md
Created Nov 15, 2018 — forked from bradtraversy/docker-help.md
Docker Commands, Help & Tips
View docker-help.md

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info

@ehzawad
ehzawad / Install_React_Native_Android_on_Ubuntu.md
Created Jun 14, 2017 — forked from eon01/Install_React_Native_Android_on_Ubuntu.md
Steps for getting a working Linux install for React Native Android
View Install_React_Native_Android_on_Ubuntu.md

Installing React Native Android on Ubuntu

Here are the steps for getting a working Linux install for React Native:

  1. Install Java SDK
  1. Install KVM
    • sudo apt-get install qemu-kvm libvirt-bin bridge-utils virt-manager
    • sudo adduser $USER libvirtd
@ehzawad
ehzawad / a2dp.py
Created Jun 1, 2017 — forked from pylover/a2dp.py
Fixing bluetooth stereo headphone/headset problem in ubuntu 16.04, 16.10 and also debian jessie, with bluez5.
View a2dp.py
#! /usr/bin/env python3.5
"""
Fixing bluetooth stereo headphone/headset problem in ubuntu 16.04 and also debian jessie, with bluez5.
Workaround for bug: https://bugs.launchpad.net/ubuntu/+source/indicator-sound/+bug/1577197
Run it with python3.5 or higher after pairing/connecting the bluetooth stereo headphone.
This will be only fixes the bluez5 problem mentioned above .
@ehzawad
ehzawad / result_checker.py
Last active May 6, 2017 — forked from SohanChy/result_checker.py
A python script to periodically check if SSC results been published or not
View result_checker.py
from urllib.parse import urlencode
from urllib.request import Request, urlopen
from os import popen
import threading
def check_result():
"""A python script to periodically check if SSC resulthas been published or not"""
timer = 5.0 #seconds
print("checking...")
@ehzawad
ehzawad / Animation.jsx
Created Mar 6, 2017 — forked from tkh44/Animation.jsx
react-router v4 animated with data-driven-motion
View Animation.jsx
import React from 'react'
import { BrowserRouter as Router, Route, Link, Redirect, matchPath } from 'react-router-dom'
import { Motion } from 'data-driven-motion' // https://github.com/tkh44/data-driven-motion
const WOBBLY_SPRING = { stiffness: 200, damping: 15, precision: 0.1 }
const AnimationExample = () => (
<Router>
<div>
<ul>
@ehzawad
ehzawad / beautiful_idiomatic_python.md
Created Jan 6, 2017 — forked from JeffPaine/beautiful_idiomatic_python.md
Transforming Code into Beautiful, Idiomatic Python: notes from Raymond Hettinger's talk at pycon US 2013. The code examples and direct quotes are all from Raymond's talk. I've reproduced them here for my own edification and the hopes that others will find them as handy as I have!
View beautiful_idiomatic_python.md

Transforming Code into Beautiful, Idiomatic Python

Notes from Raymond Hettinger's talk at pycon US 2013 video, slides.

The code examples and direct quotes are all from Raymond's talk. I've reproduced them here for my own edification and the hopes that others will find them as handy as I have!

Looping over a range of numbers

for i in [0, 1, 2, 3, 4, 5]:
@ehzawad
ehzawad / .gdbinit
Created Oct 3, 2016 — forked from skyscribe/.gdbinit
GDB init file to print STL containers and data members
View .gdbinit
#
# STL GDB evaluators/views/utilities - 1.03
#
# The new GDB commands:
# are entirely non instrumental
# do not depend on any "inline"(s) - e.g. size(), [], etc
# are extremely tolerant to debugger settings
#
# This file should be "included" in .gdbinit as following:
# source stl-views.gdb or just paste it into your .gdbinit file
@ehzawad
ehzawad / slim-redux.js
Created May 24, 2016 — forked from gaearon/slim-redux.js
Redux without the sanity checks in a single file. Don't use this, use normal Redux. :-)
View slim-redux.js
function mapValues(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
result[key] = fn(obj[key], key);
return result;
}, {});
}
function pick(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
if (fn(obj[key])) {
@ehzawad
ehzawad / binary-tricks.asm
Created Apr 18, 2016 — forked from SohanChy/binary-tricks.asm
binary tricks on numbers
View binary-tricks.asm
.model small
.stack 100h
.data
str1 db 'Ones :$'
str2 db ' zero :$'
ones db '0'
zeros db '0'
.code
main proc