Skip to content

Instantly share code, notes, and snippets.

View ehzawad's full-sized avatar
🎃
Wasteland Baby!

ehz ehzawad

🎃
Wasteland Baby!
View GitHub Profile
readnum macro num
push ax
push dx ;pushing ax,dx in stack to keep the previous values
;protected
mov ah, 01h ;read character function
int 21h ;execute the function
printstring macro msg
mov ah, 09h
mov dx, offset msg
int 21h
endm
readnum macro num
@ehzawad
ehzawad / .eslintrc
Created March 17, 2016 11:46 — forked from cletusw/.eslintrc
ESLint Reset - A starter .eslintrc file that resets all rules to off and includes a description of what each rule does. From here, enable the rules that you care about by changing the 0 to a 1 or 2. 1 means warning (will not affect exit code) and 2 means error (will affect exit code).
{
// http://eslint.org/docs/rules/
"ecmaFeatures": {
"binaryLiterals": false, // enable binary literals
"blockBindings": false, // enable let and const (aka block bindings)
"defaultParams": false, // enable default function parameters
"forOf": false, // enable for-of loops
"generators": false, // enable generators
"objectLiteralComputedProperties": false, // enable computed object literal property names
@ehzawad
ehzawad / gulpfile.js
Created March 17, 2016 21:54 — forked from wesbos/gulpfile.js
FAST Browserify + Reactify + Babelify
// Update: Hey Folks - I've got a full Gulpfile with everything else over at https://github.com/wesbos/React-For-Beginners-Starter-Files
var source = require('vinyl-source-stream');
var gulp = require('gulp');
var gutil = require('gulp-util');
var browserify = require('browserify');
var reactify = require('reactify');
var babelify = require('babelify');
var watchify = require('watchify');
var notify = require('gulp-notify');
@ehzawad
ehzawad / hex to binary.asm
Created March 20, 2016 17:51 — forked from SohanChy/hex to binary.asm
Convert single char Hex input to Binary in assembly code - intel 8086
.model small
.stack 100h
.data
countOne db ?
countZero db ?
nln db 0ah,0dh,'$'
msg1 db 'Number of Ones: $'
msg2 db 0ah,0dh,'Number of Twos: $'
.code
main proc
@ehzawad
ehzawad / tmux-cheatsheet.markdown
Created March 26, 2016 19:30 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@ehzawad
ehzawad / binary-tricks.asm
Created April 18, 2016 19:37 — forked from SohanChy/binary-tricks.asm
binary tricks on numbers
.model small
.stack 100h
.data
str1 db 'Ones :$'
str2 db ' zero :$'
ones db '0'
zeros db '0'
.code
main proc
@ehzawad
ehzawad / slim-redux.js
Created May 24, 2016 11:05 — forked from gaearon/slim-redux.js
Redux without the sanity checks in a single file. Don't use this, use normal Redux. :-)
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 / .gdbinit
Created October 3, 2016 16:42 — forked from skyscribe/.gdbinit
GDB init file to print STL containers and data members
#
# 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 / beautiful_idiomatic_python.md
Created January 6, 2017 16:48 — 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!

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]: