Skip to content

Instantly share code, notes, and snippets.

View abelyakin's full-sized avatar

Alexander Belyakin abelyakin

View GitHub Profile
#!/bin/bash
RED='\033[0;31m'
GRN='\033[0;32m'
BLU='\033[0;34m'
NC='\033[0m'
echo ""
echo -e "Auto Tools for MacOS"
echo ""
PS3='Please enter your choice: '
options=("Bypass on Recovery" "Disable Notification (SIP)" "Disable Notification (Recovery)" "Check MDM Enrollment" "Thoát")
@abelyakin
abelyakin / promisify.js
Created June 27, 2020 19:31
Promisify func
function promisify(func) {
// A new function which returns promise
return function (...args) {
return new Promise((resolve, reject) => {
// Create our custom callback function which will original function will call
let callback = function (err, response) {
// On recieving callback it will resolve or reject the promise
if (err) return reject(err);
@abelyakin
abelyakin / README-Template.md
Created July 12, 2018 10:31 — forked from mukgupta/README-Template.md
A template to make good README.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

@abelyakin
abelyakin / gist:71de092747a01d88f3c530baa2598803
Created June 29, 2017 14:57
reduce and count array elements to object
function countWords(arr) {
return arr.reduce(function(countMap, word) {
countMap[word] = ++countMap[word] || 1 // increment or initialize to 1
return countMap
}, {}) // second argument to reduce initialises countMap to {}
}
var gulp = require('gulp');
var clean = require('gulp-clean');
var jshint = require('gulp-jshint');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var imagemin = require('gulp-imagemin');
var bases = {
app: 'app/',
@abelyakin
abelyakin / 0_reuse_code.js
Created March 10, 2017 17:39
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console