Skip to content

Instantly share code, notes, and snippets.

View AlphaT7's full-sized avatar

Jamison Winters AlphaT7

View GitHub Profile
@AlphaT7
AlphaT7 / android_wireless_debugging.txt
Last active January 25, 2024 19:04
Android Wireless Debugging
## Setup Wireless Debugging on Android over local WiFi network ##
1. on your android phone: go to settings, and search for wireless debugging. tap on the "Pair device with pairing code"
a dialog will open with the necessary information for the computer
2. on your computer: open a command prompt terminal and navigate to the folder that contains adb.exe
3. on your computer: run the following terminal command:
adb.exe pair YOUR-LOCAL-IP-ADDRESS:ANDROID-PROVIDED-PORT-NUMBER ANDROID-PROVIDED-PAIR-NUMBER
@AlphaT7
AlphaT7 / Code.gs
Last active February 9, 2025 11:45
One Way Sync Script from Google Sheets App To Google Firebase RTDB
function myOnEdit() {
const RTDB_URL = "path/to/your/realtimedb/node.json";
const sheet = SpreadsheetApp.getActiveSheet();
let data = sheet.getDataRange().getValues();
let payload = {};
for (let i = 0; i < data.length; i++) {
payload[data[i][0]] = {
@AlphaT7
AlphaT7 / fetch.js
Created October 27, 2022 23:15
Fetch Multiple Resources
let resource1;
let resource2;
function fetchResources() {
// works with any type of resource; image/audio/video/json/font/txt etc;
let r1 = fetch("./assets/resource/resource1.json").then((response) => {
return response.json();
});
// launch.json
{
"version": "0.2.0",
"configurations": [
{
"type": "pwa-chrome",
"request": "attach",
"name": "Attach to Chrome",
"port": 9222,
@AlphaT7
AlphaT7 / index.html
Created May 30, 2020 12:20
JS Typing Animation
<h1>Typing Animation</h1>
<p>
<!-- In order for the curser to stay on the same line as the typing text, the typing text element must be inside of a <p> tag -->
<span id="demo" class="typing cursor"></span>
</p>
@AlphaT7
AlphaT7 / post.js
Last active March 22, 2020 14:31
PHP POST JSON JavaScript Fetch Example 2
const options = {
method: 'post',
headers: {
'Content-type': 'application/x-www-form-urlencoded; charset=UTF-8'
},
body: 'json={data: "data"}'
}
let url = "post.php";
@AlphaT7
AlphaT7 / post.js
Last active May 15, 2024 08:51
PHP POST JSON JavaScript Fetch Example 1
fetch("post.php", {
method: "post",
mode: "cors",
headers: {
"Content-Type": "application/json"
},
body: {data: "data"}
})
.then(response => {
return response.text(); // returns text that can used as html
@AlphaT7
AlphaT7 / form.html
Last active April 11, 2022 12:29
JavaScript Serialize Form Objects and convert to JSON Object
<!-- -- !IMPORTANT! -- MUST USE NAME INSTEAD OF ID FOR FORM ELEMENTS -->
<form id="form_id">
<select name="select1">
<option value="opt1" selected>Option 1</option>
<option value="opt2">Option 2</option>
<option value="opt3">Option 3</option>
</select>
<select name="select2">
<option value="opt1" selected>Option 1</option>
@AlphaT7
AlphaT7 / gist:c1f6664cec53bf125b10476b59db3e5c
Created March 20, 2018 07:41
jQuery-like .querySelector Shortcut
const $ = (q) => {return document.querySelector(q);}
@AlphaT7
AlphaT7 / socket-cheatsheet.js
Created November 4, 2017 18:33 — forked from alexpchin/socket-cheatsheet.js
A quick cheatsheet for socket.io
// sending to sender-client only
socket.emit('message', "this is a test");
// sending to all clients, include sender
io.emit('message', "this is a test");
// sending to all clients except sender
socket.broadcast.emit('message', "this is a test");
// sending to all clients in 'game' room(channel) except sender