Skip to content

Instantly share code, notes, and snippets.

View 0D1NTR33's full-sized avatar
💎
Excited by The Open Network

Odin Tree 0D1NTR33

💎
Excited by The Open Network
View GitHub Profile
@0D1NTR33
0D1NTR33 / getMiddle.js
Last active October 28, 2022 21:43
Get the Middle Character (JavaScript)
// Awesome
function getMiddle(s)
{
return s.substr(Math.ceil(s.length / 2 - 1), s.length % 2 === 0 ? 2 : 1);
}
// Usual
function GetMiddle(s)
{
var middle = Math.floor(s.length/2);
@0D1NTR33
0D1NTR33 / 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:
@0D1NTR33
0D1NTR33 / 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

@0D1NTR33
0D1NTR33 / cycle.js
Created June 4, 2018 22:44
Another var of for cycle
let i = str.length;
while (i--) {
str.charAt(i);
}
@0D1NTR33
0D1NTR33 / 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();
@0D1NTR33
0D1NTR33 / firstMessage.md
Last active December 1, 2020 12:33
Welcome message and settings for Group Butler bot for Shift Project chat

/config /lang


**All Shift, Cryptocurrency, related chat.**

**Rules:**

⛔️ No distasteful shilling: referral linking, spamming, or off topic;
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! 🚀