View repo_save_method.go
This file contains 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 | |
} |
View scammer_flood.js
This file contains 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(); |
View scrape_site_for_recaptcha.js
This file contains 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}`); |
View ts-class-deserialize.ts
This file contains 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" | |
}] |
View async_trait_send_sync_markers.rs
This file contains 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; |
View basic_event_bus.rs
This file contains 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; |
View callback_executor.rs
This file contains 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) { |
View refcell_rc_dyn.rs
This file contains 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; |
View generic_to_trait_object.rs
This file contains 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