Skip to content

Instantly share code, notes, and snippets.

View binarybaba's full-sized avatar
✍️

Amin Mohamed Ajani binarybaba

✍️
View GitHub Profile
var x = function(){};
const eventMap = {
onClick: 'click',
onChange: 'change',
onKeyDown: 'keydown',
onKeyUp: 'keyup'
}
const ROOT_KEY = '__rektroot_';
const instancesByRootID = {};
let ROOT_ID = 1;
@binarybaba
binarybaba / README.md
Created March 18, 2017 10:45 — forked from joyrexus/README.md
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@binarybaba
binarybaba / box-shadow.html
Created August 23, 2017 13:44 — forked from ocean90/box-shadow.html
CSS3 Box Shadow, only top/right/bottom/left and all
<!DOCTYPE html>
<html>
<head>
<title>Box Shadow</title>
<style>
.box {
height: 150px;
width: 300px;
margin: 20px;
@binarybaba
binarybaba / index.html
Created June 23, 2018 19:24
The amateur index
<html>
<head>
<title>Random User!</title>
<link rel="stylesheet" href="https://unpkg.com/spectre.css/dist/spectre.min.css">
</head>
<body>
<div class="container">
<h1 class="text-center">Random User!</h1>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.7.0/angular.min.js"></script>
@binarybaba
binarybaba / app.js
Created June 23, 2018 20:00
Random app init
/**
* /app.js
*/
var app = angular.module("RandomApp", []);
@binarybaba
binarybaba / userFactory.js
Last active June 23, 2018 20:24
User factory
// /userFactory.js
app.factory("UserF", function($http) {
var UserF = {};
UserF.getUsers = function(){
return $http({
method: 'GET',
url: 'https://www.reqres.in/api/users',
})
};
return UserF;
@binarybaba
binarybaba / userController.js
Last active June 23, 2018 20:24
user controller
// /userController.js
app.controller("userController", function($scope, UserF){
$scope.users = [];
UserF.getUsers()
.then(function(res) {
$scope.users = res.data.data;
})
});
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Random User!</title>
<link rel="stylesheet" href="https://unpkg.com/spectre.css/dist/spectre.min.css">
</head>
@binarybaba
binarybaba / .eslintrc.json
Created June 23, 2018 21:03
eslintrc json
// .eslintrc.json
{
"extends": [
"airbnb/legacy"
],
"env": {
"browser": true
}
}