Skip to content

Instantly share code, notes, and snippets.

View LeoColman's full-sized avatar
💭
Kotlin all day :octocat:

Leonardo Colman Lopes LeoColman

💭
Kotlin all day :octocat:
View GitHub Profile
@stoneparker
stoneparker / script.js
Last active August 18, 2023 15:55
Script to get all subjects of a USP student from jupiterweb
const puppeteer = require('puppeteer');
const credentials = require('./credentials.json');
(async () => {
const browser = await puppeteer.launch({ headless: 'new' });
const page = await browser.newPage();
// go to login page and authenticate
await page.goto('https://uspdigital.usp.br/jupiterweb/webLogin.jsp');
@tmo1
tmo1 / nextcloud-caddy-docker.md
Last active July 16, 2024 15:53
Nextcloud behind Caddy as a reverse proxy, using Docker

Introduction

This is a guide to deploying Nextcloud behind a Caddy reverse proxy, both running in Docker containers (an official Nextcloud one and a caddy-docker-proxy one), with the goal of implementing as much as possible via docker-compose files. This is much more difficult than it should be, for a variety of reasons:

  • As with Docker versions of software in general, documentation of the software does not always apply to the Docker versions, and the Docker documentation does not always include the Docker equivalent ways of doing things.

  • Docker images do not always expose the desired configuration knobs of the underlying software.

  • Nextcloud requires special configuration to run correctly behind a reverse proxy (and again, some of the instructions for this configuration requires modification for

@mpetuska
mpetuska / JSObj.kt
Created October 14, 2021 10:49
Fluent Kotlin DSL for building JSON trees
@DslMarker
annotation class JSBuilderDsl
@DslMarker
annotation class JSSetterDsl
data class JSObj(val map: MutableMap<String, Any?> = mutableMapOf()) : MutableMap<String, Any?> by map {
object Arr {
@JSBuilderDsl
operator fun get(vararg items: Any?) = items
@pawitp
pawitp / super_num.patch
Created December 21, 2019 02:25
Patch to bring back Super+<Num> shortcut on Linux Mint 19.3. This is a partial revert of https://github.com/linuxmint/cinnamon/commit/94719c2cf1525f17b38bc7356d46d5b6bb5eab59
diff -ruw grouped-window-list@cinnamon.org.bak/appGroup.js grouped-window-list@cinnamon.org/appGroup.js
--- grouped-window-list@cinnamon.org.bak/appGroup.js 2019-12-12 18:46:55.000000000 +0700
+++ grouped-window-list@cinnamon.org/appGroup.js 2019-12-21 09:10:38.809467280 +0700
@@ -780,6 +780,33 @@
return false;
}
+ onAppKeyPress() {
+ if (this.groupState.isFavoriteApp && this.groupState.metaWindows.length === 0) {
+ this.launchNewInstance();
@cakism
cakism / RuntimeConfigService.kt
Created March 21, 2019 12:27
An example client to Google Cloud Runtime Config, built in Kotlin with the Cloud Runtime Config API Java Lib
package com.experiments.services
import com.google.api.client.googleapis.auth.oauth2.GoogleCredential
import com.google.api.client.googleapis.javanet.GoogleNetHttpTransport
import com.google.api.client.http.HttpRequestInitializer
import com.google.api.client.json.jackson2.JacksonFactory
import com.google.api.services.runtimeconfig.v1beta1.CloudRuntimeConfig
import com.google.api.services.runtimeconfig.v1beta1.CloudRuntimeConfigScopes
import com.google.api.services.runtimeconfig.v1beta1.model.Variable
import com.google.api.services.runtimeconfig.v1beta1.model.WatchVariableRequest
@2E0PGS
2E0PGS / nvidia-resolution-dvi-fix.md
Last active July 13, 2021 13:02
Nvidia driver wont detect correct resolution of monitor via DVI on Ubuntu

If you have a Nvidia graphics card and have the Nvidia proprietary dirver installed and notice that it wont detect monitor information over DVI then try apply this:

First run nvidia-xconfig in a terminal to generate the /etc/X11/xorg.conf file.

Then you need to lookup your monitors specifications to find its Horizontal and Vertical refresh rates.

The edit the xorg config like so:

sudo nano /etc/X11/xorg.conf

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@HybridEidolon
HybridEidolon / build.gradle
Created May 4, 2016 18:43
Maven/Gradle bukkit examples
apply plugin: "java"
buildscript {
ext.bukkit_version = "1.9.2-R0.1-SNAPSHOT"
}
repositories {
mavenCentral()
maven {
url "https://hub.spigotmc.org/nexus/content/repositories/snapshots/"