Skip to content

Instantly share code, notes, and snippets.

View acoyfellow's full-sized avatar
🤖
Building

Jordan Coeyman acoyfellow

🤖
Building
View GitHub Profile
@acoyfellow
acoyfellow / disable-autofill.html
Created March 21, 2024 21:03
disable autofill
<script>
document.addEventListener("DOMContentLoaded", function() {
var forms = document.getElementsByTagName('form');
for(var i = 0; i < forms.length; i++) {
var fields = forms[i].getElementsByTagName('input');
for(var j = 0; j < fields.length; j++) {fill
fields[j].setAttribute('autocomplete', 'off');
}
}
});
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
async function connect(profile, i) {
try {
const a=document.querySelector(`#${profile.id} a`);
if(a===null){
run();
return;
@acoyfellow
acoyfellow / prevent-dupes.html
Last active January 4, 2024 19:14
Prevent duplicate form submissions in Phonesites.com
<script>
// Add to Custom Code > Bottom of Body
try{
if(localStorage.getItem("lead_id")){
setError("Only one submission allowed.");
throw new Error();
};
} catch(e){
console.error(e);
};
{
"Version":"2012-10-17",
"Statement":[
{
"Sid":"AddPerm",
"Effect":"Allow",
"Principal": "*",
"Action":["s3:GetObject"],
"Resource":["arn:aws:s3:::examplebucket/*"]
}
@acoyfellow
acoyfellow / script.js
Last active October 20, 2023 18:03
XHR IG login
var params = "username=username&password=password";
new Promise(function (resolve, reject) {
var http = new XMLHttpRequest();
http.open("POST", "https://www.instagram.com/accounts/login/ajax/", true);
http.setRequestHeader('x-csrftoken', window._sharedData.config.csrf_token);
http.setRequestHeader('x-instagram-ajax', '1');
http.setRequestHeader('x-requested-with', 'XMLHttpRequest');
http.setRequestHeader("pragma", "no-cache");
http.setRequestHeader("cache-control", "no-cache");
@acoyfellow
acoyfellow / example.html
Created October 17, 2023 00:50
Custom Font Example
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Pixelify+Sans&display=swap" rel="stylesheet">
<style>
* {
font-family: 'Pixelify Sans', sans-serif!important;
}
</style>
@acoyfellow
acoyfellow / formsync.html
Created January 30, 2023 20:31
FormSync + Phonesites
<script src="https://rawgit.com/acoyfellow/FormSync/master/FormSync.js"></script>
<script>
function success(){
clearFormSync();
};
</script>
@acoyfellow
acoyfellow / hooks.js
Last active February 12, 2023 01:22
hooks.js CSP example
// https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP
// https://scotthelme.co.uk/content-security-policy-an-introduction/
// scanner: https://securityheaders.com/
const rootDomain = `your-domain.com`; // or your server IP for dev
const directives = {
'img-src': [
"*",
"'self'",
@acoyfellow
acoyfellow / example.html
Created January 9, 2023 17:17
Swiper Example
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/swiper/swiper-bundle.min.css"
/>
<!-- Swiper -->
<div class="swiper mySwiper">
<div class="swiper-wrapper">
<div class="swiper-slide tc"><img src="https://firebasestorage.googleapis.com/v0/b/phonesites-prod.appspot.com/o/images%2FUZCKxREA6sNku9tDPHVFxd5PSrG3%2F1672423440866*Slide3*jpg?alt=media&token=7eb8afaf-c931-4665-a2b8-9edad704b5c5" />
</div>
@acoyfellow
acoyfellow / hidden.html
Created September 17, 2022 15:26
Hidden Field
<script>
window.beforePost= function(){
formData.hiddenField1= "My Hidden Field";
};
</script>