Skip to content

Instantly share code, notes, and snippets.

@noobnooc
noobnooc / cloudflare-worker-proxy.js
Last active June 25, 2024 09:44
cloudflare-worker-proxy
// Website you intended to retrieve for users.
const upstream = 'api.openai.com'
// Custom pathname for the upstream website.
const upstream_path = '/'
// Website you intended to retrieve for users using mobile devices.
const upstream_mobile = upstream
// Countries and regions where you wish to suspend your service.
@rougier
rougier / clean.el
Created May 10, 2020 02:43
A very minimal but elegant emacs configuration file
(require 'org)
(setq-default indent-tabs-mode nil)
(setq org-display-inline-images t)
(setq org-redisplay-inline-images t)
(setq org-startup-with-inline-images "inlineimages")
(setq default-frame-alist
(append (list '(width . 72) '(height . 40))))
@joshuadanpeterson
joshuadanpeterson / guitar_tabs_template.txt
Last active May 26, 2024 11:03
[Guitar Tabs Template] Plaintext guitar tab template #music #txt
# Guitar Tabs Template
# Created by: Ultimate Guitar
# Source URL: https://www.ultimate-guitar.com/lessons/for_beginners/guitar_tabs_template.html
-----------------------------------------------------------------
SONG NAME - Band Name
-----------------------------------------------------------------
Tabbed by:
Email:
@yurikilian
yurikilian / ApiApplication.java
Last active March 17, 2023 04:38
Soft Delete Mongo Repository
import br.com.radharsomeluz.inventory.configuration.SoftDeletionMongoRepository;
import br.com.radharsomeluz.inventory.configuration.SoftDeletionRepositoryFactoryBean;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.data.mongodb.repository.config.EnableMongoRepositories;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
@SpringBootApplication
@EnableSwagger2
@EnableMongoRepositories(
@nickyfoto
nickyfoto / video_sub_dl.sh
Last active October 20, 2023 09:31
Download video and its subtitle and merge subtitle to it.
# list available subtitles
# https://superuser.com/questions/927523/how-to-download-only-subtitles-of-videos-using-youtube-dl
youtube-dl --list-subs https://www.youtube.com/watch?v=lmWh9jV_1ac
# download a particular subtitle
youtube-dl --write-sub --sub-lang zh-CN --skip-download https://www.youtube.com/watch\?v\=lmWh9jV_1ac
# download auto generated sub
youtube-dl --write-auto-sub --sub-lang zh-CN --skip-download https://www.youtube.com/watch\?v\=lmWh9jV_1ac
@zikes
zikes / .zshrc
Last active November 14, 2022 03:45
Using kube-ps1 with P9K
# Enable the kube-ps1 oh-my-zsh plugin
plugins = (
git
kube-ps1
)
# The output of the kube_ps1 function is text, so it can be used
# directly as a custom p9k segment
POWERLEVEL9K_CUSTOM_KUBE_PS1='kube_ps1'
@jreijn
jreijn / EntityResource.java
Created May 9, 2018 22:37
IntelliJ Live template for Spring REST TDD demo
package ${PACKAGE_NAME};
import org.springframework.hateoas.Link;
import org.springframework.hateoas.Resource;
public class ${NAME} extends Resource<${ENTITY}> {
public ${NAME}(${ENTITY} content, Link... links) {
super(content, links);
}
@gwpantazes
gwpantazes / How to Install JDK MacOS Homebrew.md
Last active July 5, 2024 08:18
How to install different JDK versions on MacOS with Homebrew

How To Install Different JDK Versions on MacOS with Homebrew

Keywords: Java, JDK (Java Development Kit), MacOS, Homebrew, Specific Version

This how-to guide covers how to install different versions of the JDK on MacOS with Homebrew.

Table of Contents

@int128
int128 / RequestAndResponseLoggingFilter.java
Last active January 13, 2024 10:46
Spring Web filter for logging request and response
/*
Copyright 2017 Hidetake Iwata
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@ntamvl
ntamvl / install-multiple-jdk-on-macos-high-sierra.md
Last active February 21, 2024 11:12
Install Multiple Java Versions on macOS High Sierra

Install Multiple Java Versions on macOS High Sierra

Install Homebrew Cask

On Mac, Homebrew is the de-facto package manager, and Homebrew Cask is the app manager. I’m going to use Cask to install Java 7 and 8.

Install Homebrew Cask first if you haven’t:

brew update
brew tap caskroom/cask