Skip to content

Instantly share code, notes, and snippets.

// APIStoreProps are properties that need to be
// ignored when running APIStore.makeStore()
const APIStoreProps = ['use', 'classes', 'constructor', 'init', 'state']
// getMethods returns methods defined
// in a given class' prototype, except init and constructor
const getMethods = (cls) => {
return Object.getOwnPropertyNames(cls.prototype)
.reduce((obj, prop) => {
@timelf123
timelf123 / cloudflare-workers-apilityio.js
Created October 17, 2019 01:58 — forked from diegoparrilla/cloudflare-workers-apilityio.js
Using Cloudflare Workers and https://Apility.io API add to the request headers information of the blacklists of abusers that contains the IP address of the client.
addEventListener('fetch', event => {
event.respondWith(fetchAndCheckOrigin(event.request))
})
async function fetchAndCheckOrigin(req) {
try {
startTime = new Date();
const body = await req.body;
const ip = req.headers.get('cf-connecting-ip');
const es = req.headers.get('cf-ipcountry');
@timelf123
timelf123 / ADFS Notes
Created May 9, 2019 18:26 — forked from nullbind/ADFS Notes
ADFS Notes
Below are some notes for grabbing a list of domain users and other information via ADFS using acquired credentials.
Install Apps
Download and install visual studio 10
Downoad and install the Lync SDK
https://www.microsoft.com/en-us/download/details.aspx?id=36824 (deprecated)
http://go.microsoft.com/fwlink/?LinkID=248583
@timelf123
timelf123 / hubspot-meetings-conversion-tracking.js
Created October 26, 2018 14:37 — forked from thmsobrmlr/hubspot-meetings-conversion-tracking.js
Track conversions of Hubspot Meetings (iframe)
function isHubspotUrl(url) {
var hubspotUrls = [
'https://local.hubspot.com',
'https://app.hubspotqa.com',
'https://app.hubspot.com',
'https://meetings.hubspot.com'
];
return hubspotUrls.indexOf(url) > -1
}
// identifier(s) should be in the following format:
// {
// resultName: 'name of key that will be used in the returned object',
// identifier: 'identifier that will be searched for in the format'
// }
function breakDown(string, format, identifiers){
for(let i = 0; i < identifiers.length; i++){
const identifier = identifiers[i];
identifier.index = format.indexOf(identifier.identifier);
}
@timelf123
timelf123 / proxy-install.sh
Created October 4, 2018 19:59 — forked from samjmck/proxy-install.sh
Squid auto-install + configure to anonymous proxy
#!/bin/bash
squiddir='/etc/squid/'
lib='/usr/lib/squid/'
conf="${squiddir}squid.conf"
clients=()
authusers=()
passwd=()
sudo apt-get -y install apache2-utils
sudo apt-get -y install squid
sudo /etc/init.d/squid stop
@timelf123
timelf123 / adidas-size-code-calculator.js
Created October 4, 2018 19:59 — forked from samjmck/adidas-size-code-calculator.js
Calculate the an adidas size code by using real life sizes from different regions
function calculateSizeCode(size, type){
switch(type){
case 'USM':
return size * 20 + 530 - 80;
break;
case 'USF':
return size * 20 + 530 - 100;
break;
case 'UK':
return size * 20 + 530 - 70;
@timelf123
timelf123 / supreme-captcha-harvester.js
Created October 4, 2018 19:56 — forked from samjmck/supreme-captcha-harvester.js
Captcha harvesting for Supreme example
'use strict';
const {Harvester} = require('captcha-manager');
const request = require('request-promise-native');
const harvester = new Harvester();
const availableCaptchaResponseTokens = [];
const siteKey = '6LeWwRkUAAAAAOBsau7KpuC9AV-6J8mhw4AjC3Xz';
if (process.version.startsWith("v6")) throw new Error("This Bot requires Node 7v+ because of async/await")
const Discord = require("discord.js")
const express = require("express")
const app = express()
const superagent = require("superagent")
//Config
let INVITE = process.env.INVITE || "", //An Infinite Invite to your discord server.
GUILD = process.env.GUILD || "", //The ID of the Guild for this invite ^
@timelf123
timelf123 / portainer.txt
Created June 18, 2018 17:12 — forked from SeanSobey/portainer.md
Portainer Setup on Windows 10
Setup
=====
Enable docker without TLS
-------------------------
Docker settings -> General -> Expose docker daemon on tcp://...
Create Looback Address
----------------------