Skip to content

Instantly share code, notes, and snippets.

View converge's full-sized avatar

John Vanzuita converge

View GitHub Profile
result = ((arr) => {
let biggest = 0
let second_biggest = 0
for(let i = 0; i < arr.length; i++) {
if (arr[i] > biggest) {
second_biggest = biggest
biggest = arr[i]
} else if (arr[i] > second_biggest && arr[i] < biggest) {
wait = WebDriverWait(session.browser, 3)
element_present = EC.presence_of_element_located(
(By.XPATH, "//p[@id='slfErrorAlert']")
)
wrong_credentials = wait.until(element_present)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from flask import Flask
from flask import request
import subprocess
import shlex
app = Flask(__name__)
@app.route('/get_account_status', methods=['GET'])
""" Quickstart script for InstaPy usage """
# imports
from instapy import InstaPy
from instapy.util import smart_run
from random import sample
from random import randint
from time import sleep
# login credentials
insta_username = ''
import React, { Component } from 'react'
import socket from 'socket.io-client'
import PropTypes from 'prop-types';
import { withStyles } from '@material-ui/core/styles';
import Avatar from '@material-ui/core/Avatar';
import AccountBox from '@material-ui/icons/AccountBoxRounded';
import Card from '@material-ui/core/Card';
import CardContent from '@material-ui/core/CardContent';
import Typography from '@material-ui/core/Typography';
@converge
converge / ok.py
Last active November 19, 2018 23:15
try:
WebDriverWait(self.driver, 10).until(
EC.presence_of_element_located((By.ID, "emailFrame"))
)
self.driver.switch_to_frame(
self.driver.find_element_by_id("emailFrame"))
# click first image
'''
WebDriverWait(self.driver, 180).until(
// next step: every time there is a new log, call socket.emit('newLogData')
io.on('connection', function (socket) {
console.log('connected <-')
// @todo: windows version
var tail = spawn("tail", ["-f", filename]);
tail.stdout.on("data", function (data) {
console.log(data.toString('utf-8'))
socket.emit('newLogData', { newLog: data.toString('utf-8') } )
});
})
usernames = """tag_1
tag_2
tag_3"""
final = []
users = usernames.split('\n')
for user in users:
final.append("{}".format(user.replace('\n', ' ,')))
print(final)
converge@instapotenza:~$ cat /etc/apt/sources.list
# deb http://debian.pop-sc.rnp.br/debian/ stretch main
# deb http://debian.pop-sc.rnp.br/debian/ stretch-updates main
deb http://security.debian.org/ stretch/updates main
deb http://deb.debian.org/debian/ stretch main contrib non-free
deb-src http://deb.debian.org/debian/ stretch main contrib non-free
---
call plug#begin()
Plug 'morhetz/gruvbox'
Plug 'sheerun/vim-polyglot'
Plug 'w0rp/ale'
Plug 'jiangmiao/auto-pairs'
Plug 'NLKNguyen/papercolor-theme'
Plug 'sonph/onehalf'
Plug 'kristijanhusak/vim-hybrid-material'
Plug 'mhartington/oceanic-next'
Plug 'Chiel92/vim-autoformat'