Skip to content

Instantly share code, notes, and snippets.

View JamesHopbourn's full-sized avatar

James Hopbourn JamesHopbourn

View GitHub Profile
@JamesHopbourn
JamesHopbourn / Adblock Simple.js
Created April 14, 2024 03:28 — forked from kbauer/Adblock Simple.js
A simple adblocker bookmarklet, removing suspicious iframes. To install, copy-paste the source to a bookmark (will automatically remove newline characters). Extend the array ``exceptOrigins`` in order to create new exceptions. Careful: If bookmarklets get too long, they might stop working. This methods provides on-demand adblocking (as opposed t…
javascript:/* Adblock Simple */
(function(){
const exceptOrigins = [
'https://disqus.com',
document.origin
];
function remIF(e){
try{
var orgn = new URL(e.src || 'http://unknown-src').origin;

Copy ChatGPT Transcript as markdown

javascript:void (async () => { let { default: TD } = await import("https://cdn.skypack.dev/turndown");  let json = [   ...document.querySelectorAll(".text-base"), ].map((i) => ({   html: i.innerHTML,   text: i.innerText,   markdown: new TD().turndown(i),   isPrompt: !i.querySelector(".prose"), }));  window.open(   URL.createObjectURL(     new Blob(       [         json           .map((i) =>             i.isPrompt ? `**Prompt**: ${i.text}` : `**ChatGPT**: ${i.markdown}`           )           .join("\n\n"),       ],       { type: "text/plain" }     )   ) ); })()

Google answer

Get a quick answer from google for any question

(async function answer(q) {
  var html = await fetch(
    `https://cors.explosionscratc.repl.co/google.com/search?q=${encodeURI(q)}`,
@JamesHopbourn
JamesHopbourn / .meta.xml
Last active December 19, 2023 18:06 — forked from JoJoJotarou/.meta.xml
IDEA MybatisX template (1. 自定义 controller 模板 2. mapperInterface 添加 @Mapper 注解)
<?xml version="1.0" encoding="utf-8" ?>
<templates>
<template>
<property name="configName" value="serviceInterface"/>
<property name="configFile" value="serviceInterface.ftl"/>
<property name="fileName" value="${domain.fileName}Service"/>
<property name="suffix" value=".java"/>
<property name="packageName" value="${domain.basePackage}.service"/>
<property name="encoding" value="${domain.encoding}"/>
<property name="basePath" value="${domain.basePath}"/>
@JamesHopbourn
JamesHopbourn / BitAPI.py
Created December 20, 2022 13:26
python对接比特
"""
@Author: 小样
@Date: 2022-10-30
@UpdateDate: 2022-12-20
@wechat: mz-cyx
@description: 比特浏览器API接口
@version: 1.0
@AD: 专业定制外网自动化程序,Twitter、Facebook、Tiktok、Instagram、Google等等自动化工具;
所有本人定制软件均使用自改undetected_chromedriver,可过nowsecure.nl
@JamesHopbourn
JamesHopbourn / BitAPI.py
Created December 20, 2022 13:26
python对接比特
"""
@Author: 小样
@Date: 2022-10-30
@UpdateDate: 2022-12-20
@wechat: mz-cyx
@description: 比特浏览器API接口
@version: 1.0
@AD: 专业定制外网自动化程序,Twitter、Facebook、Tiktok、Instagram、Google等等自动化工具;
所有本人定制软件均使用自改undetected_chromedriver,可过nowsecure.nl
Data Structures
- Stacks
- Queues
- Linked lists
- Graphs
- Trees
- Tries
Concepts
- Big O Notation
@JamesHopbourn
JamesHopbourn / gist:60935e5b6cf97794c788aa3e50bc3d95
Created January 23, 2022 16:59 — forked from r3econ/gist:9953196
Posting JSON file using NSURLSession.
// URL of the endpoint we're going to contact.
NSURL *url = [NSURL URLWithString:@"http://localhost:8080/my.json"];
// Create a simple dictionary with numbers.
NSDictionary *dictionary = @{ @"numbers" : @[@1, @2, @3] };
// Convert the dictionary into JSON data.
NSData *JSONData = [NSJSONSerialization dataWithJSONObject:dictionary
options:0
error:nil];
@JamesHopbourn
JamesHopbourn / urlsafari
Created April 25, 2021 08:20 — forked from kshiteesh/urlsafari
This AppleScript saves all the tabs open in all Safari windows to a Markdown file.
(*
Export All Safari Tabs in All Open Windows to a Markdown File
July 13, 2015
// SCRIPT PAGE
http://hegde.me/urlsafari
// ORIGINAL SCRIPT ON WHICH THIS SCRIPT IS BUILT
http://veritrope.com/code/export-all-safari-tabs-to-a-text-file
@JamesHopbourn
JamesHopbourn / titleUrlMarkdownClip.js
Last active December 1, 2020 18:04 — forked from bradleybossard/titleUrlMarkdownClip.js
Bookmarklet to copy current page title and url in Markdown format to clipboard, like [title](url) - Usual for posting links to resources in README.md files
javascript: (function() {
function copyToClipboard(text) {
if (window.clipboardData && window.clipboardData.setData) {
return clipboardData.setData("Text", text);
} else if (document.queryCommandSupported && document.queryCommandSupported("copy")) {
var textarea = document.createElement("textarea");
textarea.textContent = text;
textarea.style.position = "fixed";
document.body.appendChild(textarea);
textarea.select();