This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"encoding/json" | |
) | |
type ID struct { | |
ID string | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const axios = require('axios'); | |
const HttpsProxyAgent = require('https-proxy-agent'); | |
const cheerio = require('cheerio'); | |
const getProxies = async () => { | |
const res = await axios.get('PROXY LIST'); | |
const $ = cheerio.load(res.data); | |
const elements = $( | |
'body > div.wrap > div.services_proxylist.services > div > div.table_block > table > tbody > tr', | |
).toArray(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const puppeteer = require('puppeteer'); | |
const proxy = ''; // '161.35.58.75:8080'; | |
const url = ''; | |
const sleep = ms => new Promise(resolve => setTimeout(resolve, ms)); | |
const scrape = async (browser, prefix) => { | |
const page = await browser.newPage(); | |
console.log(`Visiting ${url}`); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const json = `{ | |
"type": "two", | |
"value": 25.5, | |
"items": [{ | |
"order": 2, | |
"value": "hello" | |
}, { | |
"order": 5, | |
"value": "bye" | |
}] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::sync::Arc; | |
use async_trait::async_trait; // 0.1.36 | |
#[async_trait] | |
trait Repo { | |
async fn find(&self) -> i32; | |
} | |
struct RepoImpl; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::cell::{Cell, RefCell}; | |
use std::collections::HashMap; | |
use std::fmt::Debug; | |
use std::rc::Rc; | |
#[derive(Debug)] | |
pub struct Error; | |
pub trait Event: Debug { | |
fn code(&self) -> &str; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub trait Executor { | |
fn run(&mut self, f: &mut dyn FnMut(i32) -> i32); | |
} | |
struct SimpleExecutor { | |
v: i32, | |
} | |
impl Executor for SimpleExecutor { | |
fn run(&mut self, f: &mut dyn FnMut(i32) -> i32) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::rc::Rc; | |
use std::cell::RefCell; | |
// Databases | |
trait DB { | |
fn find(&self) -> String; | |
} | |
struct SQL; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::fmt::Debug; | |
trait Handler: Drop + Debug { | |
fn handle(&self, data: &Data); | |
} | |
#[derive(Debug)] | |
struct Processor(String); | |
impl Handler for Processor { | |
fn handle(&self, data: &Data) { |
NewerOlder