Skip to content

Instantly share code, notes, and snippets.

View Maxim-Mazurok's full-sized avatar
👨‍💻
Building great stuff

Maxim Mazurok Maxim-Mazurok

👨‍💻
Building great stuff
View GitHub Profile
@Maxim-Mazurok
Maxim-Mazurok / instagram-hashtag-images-scrape.js
Last active September 17, 2018 08:11
Scrape Instagram posts by hashtag in NodeJS (ES6)
/* Inspired by: https://github.com/AH72KING/Instagram-scraping/blob/master/instagram_hashtag_images.php */
const https = require('https');
const getContent = function (url) {
return new Promise((resolve, reject) => {
const lib = url.startsWith('https') ? require('https') : require('http');
const request = lib.get(url, (response) => {
if (response.statusCode < 200 || response.statusCode > 299) {
reject(new Error('Failed to load page, status code: ' + response.statusCode));
@Maxim-Mazurok
Maxim-Mazurok / log.txt
Created February 5, 2019 18:00
deno build log
ninja: Entering directory `/tmp/deno/target/debug'
[1/589] CXX obj/build_extra/flatbuffers/compiler_files/go_generator.o
FAILED: obj/build_extra/flatbuffers/compiler_files/go_generator.o
/tmp/deno/prebuilt/linux64/sccache ../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF obj/build_extra/flatbuffers/compiler_files/go_generator.o.d -DV8_DEPRECATION_WARNINGS -DUSE_NSS_CERTS=1 -DUSE_X11=1 -DCHROMIUM_BUILD -DFIELDTRIAL_TESTING_ENABLED -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -DCR_CLANG_REVISION=\"346388-5\" -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS -DCR_LIBCXX_REVISION=344254 -DCR_LIBCXXABI_REVISION=344215 -D_DEBUG -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DWTF_USE_DYNAMIC_ANNOTATIONS=1 -D_GLIBCXX_DEBUG=1 -I../../third_party/flatbuffers/grpc -I../.. -Igen -I../../third_party/flatbuffers/include -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__=
@Maxim-Mazurok
Maxim-Mazurok / codecanyon-mass-unfollow.js
Created May 18, 2019 23:30
Script that parses first 10 pages of your followings and prints curl-commands to unfollow them on codecanyon.net
// script that parses first 10 pages of your followings and prints curl-commands to unfollow them on codecanyon.net
const fetch = require("node-fetch");
const regex = /<a class="avatar" title="(.+?)"/gm;
//TODO: change pages count if needed
for (let page = 1; page <= 10; page++) {
fetch(`https://codecanyon.net/user/maxim_mazurok/following?page=${page}`)
.then(res => res.text())
@Maxim-Mazurok
Maxim-Mazurok / grub2-password-protection-centos.sh
Last active May 18, 2019 23:59
Protect GRUB2 with password on CentOS
# Protect GRUB2 with password on CentOS:
#
# Tested (basic):
# 1. Run:
sudo grub2-setpassword # to set root password
# 2. Update GRUB config:
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
#
# Not tested (advanced):
# 1. Run 'grub2-mkpasswd-pbkdf2' as root to generate encrypted password.
@Maxim-Mazurok
Maxim-Mazurok / error-log.txt
Created November 16, 2019 08:58
Error log for declanvong/google-api-typings-generator
/home/maxim/.nvm/versions/node/v12.13.0/bin/node /home/maxim/.nvm/versions/node/v12.13.0/lib/node_modules/npm/bin/npm-cli.js run start --scripts-prepend-node-path=auto
> gmail-api-typings-generator@ start /home/maxim/IdeaProjects/google-api-typings-generator
> ts-node src/google-api-typings-generator.ts --out ./types
/home/maxim/IdeaProjects/google-api-typings-generator/node_modules/ts-node/src/index.ts:293
return new TSError(diagnosticText, diagnosticCodes)
^
TSError: ⨯ Unable to compile TypeScript:
@Maxim-Mazurok
Maxim-Mazurok / changes.txt
Last active January 11, 2020 10:58
Google API changes gathered for Maxim-Mazurok/google-api-typings-generator
[2020-01-07T21:10:32.008Z] cloudidentity:v1beta1 changed
[2020-01-07T21:10:50.175Z] fcm:v1 changed
[2020-01-07T21:15:31.100Z] classroom:v1 changed
[2020-01-07T21:16:11.734Z] runtimeconfig:v1 changed
[2020-01-07T21:21:10.775Z] remotebuildexecution:v1alpha changed
[2020-01-07T21:21:25.053Z] sheets:v4 changed
[2020-01-07T21:26:32.119Z] tagmanager:v1 changed
[2020-01-07T21:36:09.790Z] runtimeconfig:v1beta1 changed
[2020-01-07T21:36:11.287Z] script:v1 changed
[2020-01-07T21:41:24.950Z] slides:v1 changed
@Maxim-Mazurok
Maxim-Mazurok / index.d.ts
Created January 11, 2020 08:57
Google Tasks API v1 1.0
// Type definitions for non-npm package Tasks API v1 1.0
// Project: https://developers.google.com/google-apps/tasks/firstapp
// Definitions by: Maxim Mazurok <https://github.com/Maxim-Mazurok>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
// IMPORTANT
// This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
// In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
// Generated from: https://www.googleapis.com/discovery/v1/apis/tasks/v1/rest
@Maxim-Mazurok
Maxim-Mazurok / changes.txt
Created January 15, 2020 14:17
Google API changes gathered for Maxim-Mazurok/google-api-typings-generator (ignored etag changes)
[2020-01-11T10:45:40.481Z] cloudtasks:v2 changed
[2020-01-11T10:45:44.947Z] container:v1 changed
[2020-01-11T10:46:22.845Z] servicecontrol:v1 changed
[2020-01-11T10:51:30.877Z] videointelligence:v1p2beta1 changed
[2020-01-11T11:00:36.061Z] cloudtasks:v2beta3 changed
[2020-01-11T11:01:33.275Z] videointelligence:v1 changed
[2020-01-11T11:05:45.472Z] discovery:v1 changed
[2020-01-11T11:10:39.723Z] cloudsearch:v1 changed
[2020-01-11T11:10:40.262Z] cloudtasks:v2beta2 changed
[2020-01-11T11:20:32.116Z] classroom:v1 changed
@Maxim-Mazurok
Maxim-Mazurok / neural_net_demo.py
Created January 26, 2020 21:29
Demo of very basic Neural Network in Python 3 (Siraj Raval - Build a Neural Net in 4 Minutes)
# Credits: https://www.youtube.com/watch?v=h3l4qz76JhQ
# Basic description: teach NN to output [0, 1, 1, 0] for different inputs
import numpy as np
def nonlin(x, deriv=False):
if(deriv == True):
return x*(1-x)
return 1/(1+np.exp(-x))
@Maxim-Mazurok
Maxim-Mazurok / apigee_v1.json
Created March 19, 2020 11:52
Apigee API Platform Google Cloud type defintions
{
"auth": {
"oauth2": {
"scopes": {
"https://www.googleapis.com/auth/cloud-platform": {
"description": "View and manage your data across Google Cloud Platform services"
}
}
}
},