Skip to content

Instantly share code, notes, and snippets.

@samdenty
samdenty / endpoint.ts
Last active Jul 4, 2020
comlink chrome extensions
View endpoint.ts
import * as Comlink from 'comlink';
export const PORT_ID = '@@@PORT_ID';
const ports = new Map<string, chrome.runtime.Port>();
chrome.runtime.onConnect.addListener((port) => {
if (port.name.startsWith(PORT_ID)) {
ports.set(port.name, port);
}
View binary-obfuscator.ts
class Generator {
constructor(
readonly zero: string,
readonly one: string,
readonly separator: string
) {}
encode(data: string) {
return data
.split('')
View keybase.md

Keybase proof

I hereby claim:

  • I am samdenty on github.
  • I am samdd (https://keybase.io/samdd) on keybase.
  • I have a public key whose fingerprint is CD98 4190 4626 A47F 69EC CC6D A1E1 8D50 4766 B896

To claim this, I am signing this object:

View Chrome getCompletions.js
(function getCompletions(type) {
let object;
if (type === "string") object = new String("");
else if (type === "number") object = new Number(0);
else if (type === "bigint") object = Object(BigInt(0));
else if (type === "boolean") object = new Boolean(false);
else object = this;
const result = [];
try {
for (let o = object; o; o = Object.getPrototypeOf(o)) {
View emojis.js
var t = {
people: [{
names: ["grinning"],
surrogates: "😀"
}, {
names: ["grimacing"],
surrogates: "😬"
}, {
names: ["grin"],
surrogates: "😁"
View config.template.yml
# Your WidgetBot license token
license: ''
# NEDB configuration - see https://github.com/louischatriot/nedb/wiki/Creating-loading-the-database
database:
# The path to where the NeDB database should be stored
dir: ./data/database/
# The secret to use when verifying JWT tokens
# WARNING: Keep this private. If an attacker gains ahold
View gist:6e66fd25bf422259f7c48b37e5e390ed
<!DOCTYPE HTML>
<html>
<head>
<title>Baddeveloper</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="./assets/css/main.css" />
<noscript><link rel="stylesheet" href="./assets/css/noscript.css" /></noscript>
<script src="./assets/js/particles.js"></script>
<link rel="icon" type="image/jpeg" href="./images/favicon.jpg" />
@samdenty
samdenty / Websocket emulator.js
Last active Apr 10, 2018
Websocket emulator for Chrome devtools
View Websocket emulator.js
/**
* Transport layer emulator
*/
class Transport {
constructor(/** @type {WebSocket} */ websocket) {
this.send = (...args) => websocket._send(...args)
this.close = () => websocket.close()
this.onOpen()
}
@samdenty
samdenty / DiscordCrypt.js
Created Mar 4, 2018
PoC discord realtime message decryption engine
View DiscordCrypt.js
(() => {
let styles = `
.un-decryptable,
.encrypted-msg {
background-color: rgba(255, 141, 0, 0.29);
padding: 5px;
border-radius: 5px;
}
.un-decryptable::before,
.encrypted-msg::before {
@samdenty
samdenty / README.MD
Last active May 18, 2021
VS Code CSS addition to increase readability on file tree.
View README.MD

How to install

Custom CSS plugin

Install the custom CSS plugin, then make a file on your computer that will hold your custom CSS, I like to make one in my home directory called ~/.vscodestyles.css and then add the CSS into it.

Once done, open your command palette and select enable custom CSS and JS