Skip to content

Instantly share code, notes, and snippets.

View blackavec's full-sized avatar
🎡
Coding & Composing

Mahan Sagharchi blackavec

🎡
Coding & Composing
View GitHub Profile
@blackavec
blackavec / tinder.bot.js
Created November 12, 2018 13:35
this script will start liking the profiles in a random time (human simulation) bases
window.startLiking = true
function getRandomArbitrary(min, max) {
return Math.random() * (max - min) + min;
}
function getRandomTime(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
@blackavec
blackavec / tinder-liker.js
Created October 14, 2018 13:48
tinder autoliker script
/*
copy the following script in the browser on tinder page.
and then run the following method.
$ start(300)
*/
function likeIt () {
document.querySelectorAll('button[aria-label="Like"]')[0].click()
}
function start (likeTime = 1000) {
const routeMap = [
{ from: "A", to: "B", cost: 1 },
{ from: "A", to: "C", cost: 4 },
{ from: "A", to: "D", cost: 10 },
{ from: "B", to: "E", cost: 3 },
{ from: "C", to: "D", cost: 4 },
{ from: "C", to: "F", cost: 2 },
{ from: "D", to: "E", cost: 1 },
{ from: "E", to: "B", cost: 3 },
{ from: "E", to: "A", cost: 2 },
@blackavec
blackavec / object-diff.ts
Created August 10, 2018 06:27
get a diff from 2 objects(Recursively)
function objectDiff (object, newObject, exclude) {
const result = {}
if (!exclude) {
exclude = []
}
for (const prop in newObject) {
if (newObject.hasOwnProperty(prop) && prop != '__proto__' && exclude.indexOf(newObject[prop]) == -1) {
if (
@blackavec
blackavec / random string.js
Last active April 3, 2018 06:02
create Random string from input in length of 8 char
function getRandomIntInclusive (min, max) {
min = Math.ceil(min)
max = Math.floor(max)
return Math.floor(Math.random() * (max - min + 1)) + min
}
async function codeGenerator (input) {
const inputLengthLimit = 5
/**
* Validate brackets
* write a function that accepts a string and validates braces/brackets/parentheses
* β€˜(β€˜, β€˜{β€˜, β€˜[β€˜ are openers
* β€˜)’, β€˜}’, β€˜]’ closers
* β€˜{ [ }’ should return false
* β€˜{ [ ] ( ) }’ should return true
**/
const signMap = {
@blackavec
blackavec / gulp.js
Created January 18, 2018 09:19 — forked from merlinvn/gulp.js
Gulp for C++
var gulp = require('gulp');
var exec = require('child_process').exec;
var cmakeCommand = "mkdir -p build; cd build; cmake ..;";
var cleanCommand = "rm -rf build";
var testCommand = "cd build; ctest -V";
//"cmake --build ."
@blackavec
blackavec / SimpleCart.php
Created September 18, 2017 17:34
Simple Example for add / remove cart items
<?php
// Products items
[
"id" => 1,
"name" => "test"
"price" => 30
],
[
"id" => 2,
@blackavec
blackavec / HelloWorld.java
Created October 17, 2016 02:54 — forked from lolzballs/HelloWorld.java
Hello World Enterprise Edition
import java.io.FileDescriptor;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
public class HelloWorld{
private static HelloWorld instance;
public static void main(String[] args){
instantiateHelloWorldMainClassAndRun();
import React, {
Component,
} from 'react';
import {
StyleSheet,
Text,
View,
Animated,
Easing,