Skip to content

Instantly share code, notes, and snippets.

Avatar
🔥
Busy as hell

Adi Sahar adi518

🔥
Busy as hell
View GitHub Profile
View ZMI-LPB02_ENGLISH_MANUAL.md

Battery Light Indicator

  • Green: 50-100%
  • Orange: 20-50%
  • Red: < 20%
@adi518
adi518 / matrixDigitalRain.js
Created Mar 31, 2020 — forked from danielt69/matrixDigitalRain.js
Matrix rain animation using HTML5 canvas and javascript
View matrixDigitalRain.js
// https://codepen.io/P3R0/pen/MwgoKv
var matrix = (function(){
var init = function() {
document.body.style.background = 'black';
var mdr = document.createElement('canvas');
mdr.id = "mdr";
mdr.style.display = 'block';
mdr.style.position = 'fixed';
mdr.style.top = '0';
mdr.style.left = '0';
View chrome-like-scrollbar.scss
--scrollbar-thumb-width: 9px;
--scrollbar-thumb-margin: 3px;
--scrollbar-thumb-color: rgba(255, 255, 255, 0.25);
/* Chrome-like (mobile) scrollbar */
*::-webkit-scrollbar {
width: var(--scrollbar-thumb-width);
}
*::-webkit-scrollbar-thumb {
@adi518
adi518 / git-tag-delete-local-and-remote.sh
Created Mar 17, 2020 — forked from mobilemind/git-tag-delete-local-and-remote.sh
how to delete a git tag locally and remote
View git-tag-delete-local-and-remote.sh
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
@adi518
adi518 / README-Template.md
Created Feb 17, 2020 — forked from PurpleBooth/README-Template.md
A template to make good README.md
View README-Template.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

View fibonacci_with_generators.js
function* fibonacci(limit = Infinity) {
let [prev, current] = [0, 1]
while (current < limit) {
;[prev, current] = [current, prev + current]
yield current
}
}
for (let i of fibonacci(30)) console.log(i)
@adi518
adi518 / consumer.js
Last active Oct 31, 2019
Higher-order React component for providing fallback content while server-dependent props are absent.
View consumer.js
// `MyComponent` depends on server-data, so it will render nothing
// or a fallback component until fetching is completed.
const withFallback = composeFallback(({ serverData }) => [serverData]);
export default withFallback(MyComponent);
View router.utils.js
import React from "react";
import { merge, compose } from "lodash/fp";
export const castRouterParams = (keys, caster) => WrappedComponent => ({
match,
...props
}) => {
const params = Object.fromEntries(
keys.map(key => {
const value = match.params[key];
You can’t perform that action at this time.