Skip to content

Instantly share code, notes, and snippets.

If you're using clojure.tools.logging with SLF4J.

It's often useful to 'switch on' logging for a given web request, or during the evaluation of a given form, etc.

Add this to your logback.xml configuration:

  <turboFilter class="ch.qos.logback.classic.turbo.MDCFilter">
    <MDCKey>logging</MDCKey>
    <Value>on</Value>
@pierrejoubert73
pierrejoubert73 / markdown-details-collapsible.md
Last active May 1, 2024 11:05
How to add a collapsible section in markdown.

How to add a collapsible section in markdown

1. Example

Click me

Heading

  1. Foo
  2. Bar
    • Baz
  • Qux
@roommen
roommen / Hybrid (Windows+Linux) Docker Swarm
Last active May 1, 2024 11:04
Hybrid (Windows+Linux) Docker Swarm
**********************
*** Pre-requisites ***
**********************
1. Set up Windows 2016 password:
gcloud beta compute --project <project_id> reset-windows-password <instance_name> --zone <zone_name>
ip_address: <ip_address>
password: <defult_password_generated>
username: <username>
3. Installing Docker:
@rahularity
rahularity / work-with-multiple-github-accounts.md
Last active May 1, 2024 11:01
How To Work With Multiple Github Accounts on your PC

How To Work With Multiple Github Accounts on a single Machine

Let suppose I have two github accounts, https://github.com/rahul-office and https://github.com/rahul-personal. Now i want to setup my mac to easily talk to both the github accounts.

NOTE: This logic can be extended to more than two accounts also. :)

The setup can be done in 5 easy steps:

Steps:

  • Step 1 : Create SSH keys for all accounts
  • Step 2 : Add SSH keys to SSH Agent
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active May 1, 2024 11:01
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@karpathy
karpathy / min-char-rnn.py
Last active May 1, 2024 11:00
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active May 1, 2024 11:00
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This no longer works in browser!

Note

This no longer works if you're alone in vc! Somebody else has to join you!

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
@mlocati
mlocati / color-scale.js
Last active May 1, 2024 10:55
Javascript color scale from 0% to 100%, rendering it from red to yellow to green
// License: MIT - https://opensource.org/licenses/MIT
// Author: Michele Locati <michele@locati.it>
// Source: https://gist.github.com/mlocati/7210513
function perc2color(perc) {
var r, g, b = 0;
if(perc < 50) {
r = 255;
g = Math.round(5.1 * perc);
}
else {
@sundowndev
sundowndev / GoogleDorking.md
Last active May 1, 2024 10:55
Google dork cheatsheet

Google dork cheatsheet

Search filters

Filter Description Example
allintext Searches for occurrences of all the keywords given. allintext:"keyword"
intext Searches for the occurrences of keywords all at once or one at a time. intext:"keyword"
inurl Searches for a URL matching one of the keywords. inurl:"keyword"
allinurl Searches for a URL matching all the keywords in the query. allinurl:"keyword"
intitle Searches for occurrences of keywords in title all or one. intitle:"keyword"