Skip to content

Instantly share code, notes, and snippets.

View ammaratef45's full-sized avatar
🥰
love open-source

Ammar Hussein ammaratef45

🥰
love open-source
View GitHub Profile
@ammaratef45
ammaratef45 / designs.js
Last active May 1, 2019 22:08
Pixel art maker un-color if colored
//Variables to define elements
const color = document.getElementById("colorPicker");
const height = document.getElementById("inputHeight");
const width = document.getElementById("inputWidth");
//Variables to define user input responses for options
let colorInput = "#000000";
color.addEventListener('change', function(response) {
colorInput = response.target.value;
});
@ammaratef45
ammaratef45 / designs.js
Created April 9, 2019 06:51
Art Pixel maker with saving the art image allowed.
//imports useful elements, and assigns them to variables
var canvas = document.getElementById("pixelCanvas");
var color = document.getElementById("colorPicker");
var sizePicker = document.getElementById("sizePicker");
var height = document.getElementById("inputHeight");
var width = document.getElementById("inputWidth");
var toggle = document.getElementById("gridToggle");
var save = document.getElementById("saveArt");
//function to create grid and assign event listeners to all cells on creation
@ammaratef45
ammaratef45 / installRedis.sh
Last active February 10, 2019 06:01
Redis installation and running script
#!/bin/bash
sudo apt install make gcc libc6-dev tcl
wget http://download.redis.io/redis-stable.tar.gz
tar xvzf redis-stable.tar.gz
cd redis-stable
sudo make install
src/redis-server
package com.tutorial.notification.ammar;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.support.v4.app.NotificationCompat;
import android.support.v4.app.TaskStackBuilder;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_notifications"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.tutorial.notification.ammar.MainActivity"
android:orientation="vertical">
<Button