Skip to content

Instantly share code, notes, and snippets.

View maietta's full-sized avatar

Nick Maietta maietta

View GitHub Profile
@guillemcanal
guillemcanal / puppeteer.js
Created April 2, 2019 22:05
control a chrome instance running on you Mac using a containerized puppeteer script
// First, run a Chrome instance on your Mac:
// /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222 &> /dev/null &; disown
const puppeteer = require('puppeteer-core');
const axios = require('axios');
const getBrowserWSEndpoint = async (baseUrl) => {
const response = await axios.get(`http://${baseUrl}/json/version`);
return response.data.webSocketDebuggerUrl;
@drbh
drbh / checkIsBrave.js
Created January 30, 2019 20:19
Reliably detect Brave Browser with native JS
// helper to find Brave in User Agent string
function isBraveAgent(userAgentResponse) {
var isBraveIndex = ~userAgentResponse.indexOf('Brave')
if (isBraveIndex < 0) {
return true
}
return false
}
// Function from Javarome
@cliffrowley
cliffrowley / STREAMDECK_HID.md
Last active May 10, 2025 13:06
Notes on the Stream Deck HID protocol

Stream Deck Protocol

How to interface with a Stream Deck device.

Synopsis

The device uses the HID protocol to communicate with its software.

Configuration

@xon52
xon52 / xon-GridCanvas.vue
Last active March 5, 2024 09:23
Medium - Flexible Canvas Grid (without blurred lines)
<template>
<canvas class="gridCanvas"
:width="width"
:height="height"
></canvas>
</template>
<script>
export default {
name: 'xon-GridCanvas',
@adisheshsm
adisheshsm / multipart_upload.go
Created December 27, 2017 10:07 — forked from mattetti/multipart_upload.go
Example of doing a multipart upload in Go (golang)
package main
import (
"bytes"
"fmt"
"io"
"log"
"mime/multipart"
"net/http"
"os"
#!/bin/bash
# 用于创建macOS安装ISO的脚本文件
# 初始脚本来源:http://www.insanelymac.com/forum/topic/308533-how-to-create-a-bootable-el-capitan-iso-fo-vmware/
set -x
SCRIPT_PATH=`pwd`/$0
DMG_PATH="/Applications/Install macOS High Sierra.app/Contents/SharedSupport"
@jessfraz
jessfraz / boxstarter.ps1
Last active March 4, 2025 09:17
Boxstarter Commands for a new Windows box.
# Description: Boxstarter Script
# Author: Jess Frazelle <[email protected]>
# Last Updated: 2017-09-11
#
# Install boxstarter:
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
#
# You might need to set: Set-ExecutionPolicy RemoteSigned
#
# Run this boxstarter by calling the following from an **elevated** command-prompt:
@ssalonen
ssalonen / OpenWrt SSH tunnel.md
Last active October 7, 2024 15:56
OpenWrt SSH tunnel

Short how-to for creating a reverse ssh tunnel to a remote server. Useful for breaking NATted connection for example.

  1. At OpenWrt:
opkg update
opkg install sshtunnel
  1. At remote server: create client ssh keys
@steveheinsch
steveheinsch / gist:287edd5ce26e608b06b20af384f4cc1e
Last active September 26, 2022 21:53
Function to retrieve all lookup key/values for a Resource/Class in PHRETS 2+
<?php
// Note: $this->server is a "logged in" PHRETS $session
public function getLookupValues($resourceName, $className)
{
$results = array();
// Get Table Metadata for this resource/class
$tableMeta = $this->server->GetTableMetadata($resourceName, $className);
@cyrusboadway
cyrusboadway / google-domains-dynamic-dns-update.sh
Created February 20, 2016 17:21
Script to update a Google Domains DNS record
#!/bin/bash
### Google Domains provides an API to update a DNS "Syntheitc record". This script
### updates a record with the script-runner's public IP, as resolved using a DNS
### lookup.
###
### Google Dynamic DNS: https://support.google.com/domains/answer/6147083
### Synthetic Records: https://support.google.com/domains/answer/6069273
USERNAME=""