Skip to content

Instantly share code, notes, and snippets.

View BookRepository.kt
interface BookRepository {
suspend fun getBooks(query: String): List<Book>
fun getLocalBooks(): List<Book>
}
@aswinsanakan
aswinsanakan / git-config-rsa-https.md
Created Dec 28, 2020
Change Git from using RSA key to HTTPS
View git-config-rsa-https.md

Change the value of url in the .git/config file in your repo.

Using RSA key

[core]
        repositoryformatversion = 0
        filemode = true
        bare = false
        logallrefupdates = true
@Stovoy
Stovoy / stovoy.caffeinate.plist
Created Dec 28, 2020
Autostart caffeinate on Mac boot - put in ~/Library/LaunchAgents/stovoy.caffeinate.plist
View stovoy.caffeinate.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>stovoy.caffeinate</string>
<key>OnDemand</key>
<false/>
View deploy_zabbix_docker.sh
docker network create --subnet 172.20.0.0/16 --ip-range 172.20.240.0/20 zabbix-net
docker run --name postgres-server -t -e POSTGRES_USER="zabbix" -e POSTGRES_PASSWORD="zabbix_pwd" -e POSTGRES_DB="zabbix" --network=zabbix-net --restart unless-stopped -d postgres:latest
docker run --name zabbix-snmptraps -t -v /zbx_instance/snmptraps:/var/lib/zabbix/snmptraps:rw -v /var/lib/zabbix/mibs:/usr/share/snmp/mibs:ro --network=zabbix-net -p 162:1162/udp --restart unless-stopped -d zabbix/zabbix-snmptraps:alpine-5.2-latest
docker run --name zabbix-server-pgsql -t -e DB_SERVER_HOST="postgres-server" -e POSTGRES_USER="zabbix" -e POSTGRES_PASSWORD="zabbix_pwd" -e POSTGRES_DB="zabbix" -e ZBX_ENABLE_SNMP_TRAPS="true" --network=zabbix-net -p 10051:10051 --volumes-from zabbix-snmptraps --restart unless-stopped -d zabbix/zabbix-server-pgsql:alpine-5.2-latest
docker run --name zabbix-web-nginx-pgsql -t -e ZBX_SERVER_HOST="zabbix-server-pgsql" -e DB_SERVER_HOST="postgres-server" -e POSTGRES_USER="zabbix" -e POSTGRES_PASSWORD=
@bbscout
bbscout / infiniteScroll.js
Created Dec 28, 2020
Infinite scroll - loading more content when reaching bottm of document (or
View infiniteScroll.js
window.onscroll = function() {
var offset = 100; //set offset from bottom
var loading = false;
var scrolledToOffset = document.documentElement.scrollTop + window.innerHeight + offset > document.documentElement.offsetHeight;
if ( scrolledToOffset && !loading ) {
function() {
loading = true; //block running function more than once before finishing previous request
//do something when reaching offset from bottom; e.g. load more content with AJAX
loading = false; //pass this in callback function when using async call
}
View Potential Maintainers
Maintainers:
llathasa-veleth: disfetch, disfetch, disfetch, disfetch
View Changed Paths
aarch64-linux disfetch
i686-linux disfetch
x86_64-darwin disfetch
x86_64-linux disfetch
View funy wallpaper gen
# overlays trending headline from trump subreddit ontop of a nice scenic background
import ctypes
import os
import praw
import requests
from PIL import ImageFont, ImageDraw, Image
@HugsLibRecordKeeper
HugsLibRecordKeeper / output_log.txt
Created Dec 28, 2020
Rimworld output log published using HugsLib
View output_log.txt
This file has been truncated, but you can view the full file.
Log uploaded on Monday, December 28, 2020, 8:41:11 AM
Loaded mods:
Harmony(brrainz.harmony)[mv:1.0.4.0]: 0Harmony(2.0.2), HarmonyMod(1.0.4)
Core(Ludeon.RimWorld): (no assemblies)
Royalty(Ludeon.RimWorld.Royalty): (no assemblies)
HugsLib(UnlimitedHugs.HugsLib)[ov:8.0.1]: 0Harmony(av:2.0.2,fv:1.2.0.1), HugsLib(av:1.0.0,fv:8.0.1)
A Dog Said... Animal Prosthetics(spoonshortage.ADogSaidAnimalProsthetics): (no assemblies)
Achtung!(brrainz.achtung)[mv:3.1.3.0]: 0Harmony(av:2.0.2,fv:2.0.4), 0MultiplayerAPI(av:0.2.0,fv:0.1.0), AchtungMod(3.1.3)
All your base(RimWorldCCLReborn.AllYourBase): Assembly(av:0.1.0.1,fv:1.0.0)
You can’t perform that action at this time.