Skip to content

Instantly share code, notes, and snippets.

View d3cline's full-sized avatar
🎯
Focusing

John Spounias d3cline

🎯
Focusing
View GitHub Profile
@d3cline
d3cline / gist:7dd28808e45d1bb1d7fb01d4f3b6830a
Created October 2, 2023 04:59
Kill 'Suggested for you' from FB
function changeColorOfSuggestedForYou(parentLevels = 0) {
let spans = document.querySelectorAll('span[dir="auto"]');
for (let span of spans) {
if (span.textContent.trim() === 'Suggested for you') {
span.style.color = 'red';
let parent = span;
for (let i = 0; i < parentLevels; i++) {
parent = parent.parentElement;
if (parent && parent.tagName.toLowerCase() === 'div') {
@d3cline
d3cline / bookstack.txt
Last active January 6, 2023 19:02
How to build BookStack on Opalstack.
Prefece: BookStack is seemingly a normal laravel app.
This means you need to check it out to a directory someplace,
install its deps, config the DB, and point a symlink apache app to the 'public' sub directory.
Create a new OSUser for this app to live in, it makes deployment a little easier.
Shell commands,
mkdir ~/src
cd ~/src
<a href="//dobbs.town/@Homoevolutis0&quot;&gt;Mastodon&lt;/a&gt;">&lt;a rel="me" href="https://dobbs.town/@Homoevolutis0"&gt;Mastodon&lt;/a&gt;</a></p><p> </p><p>&lt;a rel="me" href="https://dobbs.town/@Homoevolutis0"&gt;Mastodon&lt;/a&gt;</p></div>
@d3cline
d3cline / spider.py
Last active March 25, 2023 14:11
mastodon account note spider (all connected peers)
import requests
# What you want to search, lower case
SEARCH_TERM = "birdsite"
# Your home instance URL
INSTANCE_URL="https://opalstack.social"
# Number of accounts to search before stop
MAX_OFFSET = 10000
def grab_instance_domains():
@d3cline
d3cline / spider.py
Last active December 13, 2022 03:38
Mastodon account note spider (single instance)
import requests
# What you want to search, lower case
SEARCH_TERM = "anthropology"
# Your home instance URL
INSTANCE_URL="https://opalstack.social"
# Number of accounts to search before stop
MAX_OFFSET = 10000
def spider():
@d3cline
d3cline / gist:d2ff3999363e78ce9f8a3c934fd395aa
Created December 3, 2022 02:40
FastAPI manual install
curl -X POST --header "Content-Type:application/json" --header "Authorization: Token YOURAPITOKENHERE" -d'[{"osuser": "OSUSER-UUID", "name": "fastapi", "type": "CUS", "installer_url": "https://raw.githubusercontent.com/opalstack/installers/master/core/fastapi/install.py"}]' https://my.opalstack.com/api/v1/app/create/
@d3cline
d3cline / Bubo
Created February 20, 2020 17:46
#include <Wire.h>
#include "SparkFunBME280.h"
BME280 mySensor;
#include <LiquidCrystal.h>
//LCD pin to Arduino
const int pin_RS = 8;
const int pin_EN = 9;
const int pin_d4 = 4;
const int pin_d5 = 5;
@d3cline
d3cline / quickstart.sh
Created May 19, 2019 20:48 — forked from i12n/quickstart.sh
A simple 'hello world' python application with uwsgi and nginx
# A simple 'hello world' application with python uwsgi and nginx
# Make directory and files
# The directory structure:
# ./
# |-- app/
# | |-- hello.py
# | |-- hello_nginx.conf
if [ -d app ]; then
rm -rf app
@d3cline
d3cline / validators.py
Created May 18, 2019 02:51
Django DomainNameValidator adapted from EmailValidator
from django.core.exceptions import ValidationError
from django.core.validators import validate_ipv46_address
from django.utils.deconstruct import deconstructible
from django.utils.encoding import force_text
from django.utils.translation import ugettext_lazy as _
import re
@deconstructible
class DomainNameValidator(object):

Keybase proof

I hereby claim:

  • I am d3cline on github.
  • I am d3cline (https://keybase.io/d3cline) on keybase.
  • I have a public key ASCIp9AdfD_bbe7BF4ygqib0tpAC2X3VkLZhlUERkEGv-go

To claim this, I am signing this object: