Skip to content

Instantly share code, notes, and snippets.

View KevinPayravi's full-sized avatar

Kevin Payravi KevinPayravi

View GitHub Profile
@nolanlawson
nolanlawson / scaling_mastodon_down.md
Last active July 23, 2023 06:34
Scaling Mastodon down

Scaling Mastodon down

There is already a guide on scaling your Mastodon server up. This is a short guide on scaling your Mastodon server down.

I.e., maybe you want to run a small instance of <100 active users, and you want to keep your cloud costs reasonable. So you might be running everything on a single machine, with limited memory and CPU. (In my case, I was using a t3.medium instance with 2 vCPUs and 4GB of RAM.) How do you do this?

Note that I'm not a Ruby or Sidekiq expert, and most of this stuff I figured out through trial and error.

@waggz81
waggz81 / logwatcher.sh
Last active February 27, 2021 22:50
Valheim Server Discord Alerts
#!/bin/bash
##########################
# Change these variables #
##########################
FILE="/path/to/console.log"
WEBHOOK_URL="CHANGEME"
STEAMKEY="CHANGEME"
##########################
|name= seaweed
|ja-name= ワカメ
|ko-name= 미역
|zh-name= 裙带菜
|fr-name= wakame
|it-name= alga wakame
|es-name= alga wakame
|de-name= Wakame-Alge
|nl-name= zeewier
|ru-name= морские водоросли
@avafloww
avafloww / PhpJava.java
Last active October 16, 2022 18:50
This snippet of code is syntactically valid in both PHP and Java, and produces the same output in both.
/*<?php
//*/public class PhpJava { public static void main(String[] args) { System.out.printf("/*%s",
//\u000A\u002F\u002A
class PhpJava {
static function main() {
echo(//\u000A\u002A\u002F
"Hello World!");
}}
//\u000A\u002F\u002A
PhpJava::main();
@brianckeegan
brianckeegan / top_wikipedia_articles_by_editors.py
Last active June 19, 2021 13:31
Top Wikipedia stories in 2014
import numpy as np
import pandas as pd
from bs4 import BeautifulSoup, element
import urllib2, re
# Read the HTML from the webpage on Wikipedia stats and convert to soup
soup = BeautifulSoup(urllib2.urlopen('http://stats.wikimedia.org/EN/TablesWikipediaEN.htm').read())
# Look for all the paragraphs with 2014
_p = soup.findAll('b',text=re.compile('2014'))
using System;
namespace FortyOneShades
{
class Program
{
static int[] values = new int[]{
0x276AD9,
0x3E6FD9,
0x3A6FDE,
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active April 20, 2024 16:52
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';