Skip to content

Instantly share code, notes, and snippets.

View arvindkgs's full-sized avatar

Arvind Kumar GS arvindkgs

View GitHub Profile
package com.example.custombodyannotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
@martinwoodward
martinwoodward / mermaid.md
Created February 11, 2022 20:34
GitHub HTML Rendering Pipeline
```mermaid
sequenceDiagram
    participant dotcom
    participant iframe
    participant viewscreen
    dotcom->>iframe: loads html w/ iframe url
    iframe->>viewscreen: request template
    viewscreen->>iframe: html & javascript
 iframe->>dotcom: iframe ready
@usametov
usametov / topics-search.txt
Created February 16, 2021 01:50
how to search github.com for multiple topics
Github.com ui .currently does not natively supoport search for multiple topic tags as of now. However their api allows you to query multiple tags. Below is a simple example to query github.com with ecs and go topic tags.
curl -H "Accept: application/vnd.github.mercy-preview+json" \
https://api.github.com/search/repositories?q=topic:ecs+topic:go
Response from the github can be rather verbose so lets filter only relavant info such repo url and description.
curl -H "Accept: application/vnd.github.mercy-preview+json" \
https://api.github.com/search/repositories\?q\=topic:ecs+topic:go | jq '.items[] | {url:.url, description:.description}'

Setup tor proxy on Arch Linux

Copied from this article.

Installation

  1. Install tor

         $ sudo pacman -S tor
         $ ## nyx provides a terminal status monitor for bandwidth usage, connection details and more.

$ sudo pacman -S nyx

@BigOokie
BigOokie / pgrep-regex-example.txt
Last active April 13, 2023 10:58
Use pgrep with regex patterns to identify specific processes and command line flags
Use the following pattern for `pgrep` to identify a running process that contains specific commandline parameters
Note the following pgrep options are needed:
-a, --list-full list PID and full command line
-f, --full use full process name to match
-c, --count count of matching processes
To find a specific process with a specific commandline parameter use the following:
pgrep -a -f "{processname}.*{commandline param}"

Install Minikube with virtual-box VM driver

$ brew update && brew install kubectl && brew cask install docker minikube virtualbox
$ brew cask reinstall minikube
$ minikube delete
$ rm -fr ~/.minikube/
@bcnzer
bcnzer / postman-pre-request.js
Last active June 4, 2024 08:55
Postman pre-request script to automatically get a bearer token from Auth0 and save it for reuse
const echoPostRequest = {
url: 'https://<my url>.auth0.com/oauth/token',
method: 'POST',
header: 'Content-Type:application/json',
body: {
mode: 'application/json',
raw: JSON.stringify(
{
client_id:'<your client ID>',
client_secret:'<your client secret>',
@steven2358
steven2358 / ffmpeg.md
Last active June 7, 2024 12:16
FFmpeg cheat sheet
@dsyer
dsyer / config-props.md
Created November 2, 2017 10:25
Notes on Dynamic Configuration Properties

Dynamic Configuration Properties in Spring Boot and Spring Cloud

TL;DR

  • Use @ConfigurationProperties and always get state from the bean.
  • The Environment can change at runtime and Spring Cloud does this for you using RefreshEvent.
  • Changes are propagated to beans in Spring Cloud in 2 ways (@ConfigurationProperties and @RefreshScope).
  • If you care about the state of @ConfigurationProperties being consistent on concurrent access, put it or the consumer @Bean in @RefreshScope.

Typical Scenarios