Skip to content

Instantly share code, notes, and snippets.

@maaduukaar
maaduukaar / findEvenIndex.js
Created May 30, 2018 03:57
Equal Sides Of An Array
// awesome
function findEvenIndex(arr)
{
for(var i=1; i<arr.length-1; i++) {
if(arr.slice(0, i).reduce((a, b) => a+b) === arr.slice(i+1).reduce((a, b) => a+b)) {
return i;
}
}
return -1;
}
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
driver = webdriver.Firefox()
driver.get("http://www.kinopoisk.ru/film/596001/")
try:
@maaduukaar
maaduukaar / IllegalContent.md
Last active June 3, 2018 19:23
Discussion about illegal content in Shift IPFS Cluster

rexy Fri

Here's my understanding of some of the likely scenarios. Someone please correct me if something is wrong or describe another scenario if you think one is missing:

Scenario 1: John A. lives in the US and wants to host DrumpLies.net, a website critical of the US president. He uploads the site to the Shift ipfs cluster, pays to have the site pinned on 100 hosting nodes and points his domain to the cluster with the help of Jenga. His site is up and stays up.

Scenario 2: John B. lives in Morocco and wants to host a website, Mkingleaks.org, with leaked documents that show that the Moroccan King has embezzled millions of dollars. He uploads the site to the Shift ipfs cluster, pays to have the site pinned on 100 hosting nodes and points his domain to the cluster with the help of Jenga. Morocco blocks the domain and tries to seize it but ICANN denies their request. John B. can keep the content on Phantom since it hasn’t been removed from the cluster and people in Morocco can access the content

@maaduukaar
maaduukaar / cycle.js
Created June 4, 2018 22:44
Another var of for cycle
let i = str.length;
while (i--) {
str.charAt(i);
}
@maaduukaar
maaduukaar / duplicateEncodeString.js
Last active June 5, 2018 00:05
Duplicate Encoder for string
//original
function duplicateEncode(word) {
let result = '';
let textHash = {};
for (let i = 0; i < word.length; i++) {
let key = word.charAt(i).toLowerCase();
QmWDNecTW4Y3fJCw2bcErnBMfHJvWbdkWN3yX43KSrh4Dt
✨ Hello shifters! Phantom is here! 🚀
http://gateway-testnet.shiftnrg.org/ipfs/QmYQrKqwPdkfjMn4ir2wcStMQ6XEEYdMA55GKptF1WJD2M
✨ Hello shifters! Phantom is working now! 🚀
http://gateway-testnet.shiftnrg.org/ipfs/QmeLPAcWm6gQNPUbmTFntjxJGX1XycSMUHkMKWyyTDrAbM
✨ Hello shifters! Shift IPFS-cluster is here! 🚀
✨ Hello shifters! Shift IPFS-cluster is here! 🚀
<!DOCTYPE html>
<!--[if lt IE 9 ]><html class="ie ie-lt9 no-js" lang="en"><![endif]-->
<!--[if IE 9 ]><html class="ie ie9 no-js" lang="en"><![endif]-->
<!--[if gt IE 9 | !IE]><!-->
<html class="no-js fixed" lang="en">
<!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
@maaduukaar
maaduukaar / chrontab
Last active June 17, 2018 00:49 — forked from ziadoz/install.sh
Install Chrome, ChromeDriver and Selenium on Ubuntu 16.04
chrontab -e
# Start GoGreen Bot every 6 hours
0 */6 * * * python3 ~/go-green/bot.py >> ~/go-green/bot.log 2>&1
# Start GoGreen Bot every 1 minute without overlapse
* * * * * /usr/bin/pgrep -f ~/go-green/bot.py >> ~/go-green/bot.log 2>&1 || python3 ~/go-green/bot.py >> ~/go-green/bot.log 2>&1