Skip to content

Instantly share code, notes, and snippets.

View jessejjohnson's full-sized avatar

Jesse Johnson jessejjohnson

View GitHub Profile
@SomeHats
SomeHats / runDevBrowser.mjs
Last active May 21, 2024 08:29
A hacky local version of cloudflare's browser rendering API. To use this, copy either runDevBrowser.ts or runDevBrowser.mjs and install the puppeteer and ws packages from npm. Run the dev server alongside wranger with `node runDevServer.mjs` or `tsx runDevServer.ts`
/* eslint-disable no-console */
/***
* This is a little server that emulates the protocol used by cloudflare's browser rendering API. In
* local development, you can run this server, and connect to it instead of cloudflare's (strictly
* limited) API. e.g. in your worker you might use a function like this:
*
* ```ts
* import { Browser, launch as launchPuppeteer } from '@cloudflare/puppeteer'
* function launchBrowser(env: Environment) {
* if (env.LOCAL_BROWSER_ORIGIN) {
@ngraf
ngraf / PlaywrightNetwork.js
Last active February 4, 2024 03:15
CodeceptJS helper for test/block/mock network traffic with Playwright
const assert = require('assert');
/**
* Helps you test network traffic with Playwright.
*
* - mockTraffic
* - blockTraffic
* - startRecordingTraffic
* - seeTraffic
* - dontSeeTraffic
@dmozgovoi
dmozgovoi / HttpClient.ts
Created October 19, 2022 08:00
HttpClient variation with flexible output format parsing
import * as http from 'http';
import * as https from 'https';
import got, { Got, ExtendOptions, Headers, CancelableRequest, Response } from 'got';
import CacheableLookup from 'cacheable-lookup';
import { decodeData, TypeOf, TSchema } from '../decoder';
export const DefaultHttpClientOptions = {
keepAlive: true,
maxSockets: 10,
@Phate6660
Phate6660 / lobsters-dark.css
Last active January 16, 2022 08:42
A dark userstyle for https://lobste.rs that aims to be simple and robust.
body, textarea, input, button {
font-size: 11px;
}
a {
color: green;
}
p>a {
color: green !important;
@davidteren
davidteren / nerd_fonts.md
Last active July 24, 2024 20:04
Install Nerd Fonts via Homebrew [updated & fixed]
@alirezamika
alirezamika / autoscraper-examples.md
Last active July 3, 2024 21:02
AutoScraper Examples

Grouping results and removing unwanted ones

Here we want to scrape product name, price and rating from ebay product pages:

url = 'https://www.ebay.com/itm/Sony-PlayStation-4-PS4-Pro-1TB-4K-Console-Black/203084236670' 

wanted_list = ['Sony PlayStation 4 PS4 Pro 1TB 4K Console - Black', 'US $349.99', '4.8'] 

scraper.build(url, wanted_list)
[alias]
ci = commit
co = checkout
cm = checkout master
cb = checkout -b
st = status -sb
sf = show --name-only
lg = log --pretty=format:'%Cred%h%Creset %C(bold)%cr%Creset %Cgreen<%an>%Creset %s' --max-count=30
incoming = !(git fetch --quiet && git log --pretty=format:'%C(yellow)%h %C(white)- %C(red)%an %C(white)- %C(cyan)%d%Creset %s %C(white)- %ar%Creset' ..@{u})
outgoing = !(git fetch --quiet && git log --pretty=format:'%C(yellow)%h %C(white)- %C(red)%an %C(white)- %C(cyan)%d%Creset %s %C(white)- %ar%Creset' @{u}..)
@X-KG-X
X-KG-X / gist:e628cb88b2ee0825c8413c47643bf919
Last active November 16, 2019 07:21
Kushal Gurung Resume

KUSHAL GURUNG

Renton, Washington 98055 | (320)237-6783 | xushalx@gmail.com | https://www.linkedin.com/in/kushalx/

SUMMARY

I am passionate about using Data and Technology to solve problems small and large. As a military veteran I have ample experience working in teams of varying sizes to accomplish the Mission. As a professional I have always taken complete ownership of my responsibilities with a positive attitude.

Fullstack Development | MCSE: Data Management and Analytics | Secret Security Clearance

How To: Setting up ASPNetZero With Modular Application

Preparing AspNetZero Project

  1. Create a github repo "jpy-d360"

    clone the above create repo to working directory

  2. Get the latest version of AspNetZero Binary

    Company name : "JPY" Project name : "Zero"

@macbookandrew
macbookandrew / findStyles.js
Last active March 30, 2024 15:24
List unique CSS properties for all DOM elements
/**
* List unique CSS properties for all DOM elements
* Initially created to list unique font stacks on a page
* @see {@link http://stackoverflow.com/a/35022690/ Inspired by this StackOverflow answer}
*
* @see {@link https://gist.github.com/macbookandrew/f33dbbc0aa582d0515919dc5fb95c00a/ URL for this file}
*
* @author AndrewRMinion Design (https://andrewrminion.com)
* @version 1.1
*