Skip to content

Instantly share code, notes, and snippets.

View danielsz's full-sized avatar

Daniel Szmulewicz danielsz

View GitHub Profile
@reborg
reborg / rich-already-answered-that.md
Last active May 8, 2024 14:20
A curated collection of answers that Rich gave throughout the history of Clojure

Rich Already Answered That!

A list of commonly asked questions, design decisions, reasons why Clojure is the way it is as they were answered directly by Rich (even when from many years ago, those answers are pretty much valid today!). Feel free to point friends and colleagues here next time they ask (again). Answers are pasted verbatim (I've made small adjustments for readibility, but never changed a sentence) from mailing lists, articles, chats.

How to use:

  • The link in the table of content jumps at the copy of the answer on this page.
  • The link on the answer itself points back at the original post.

Table of Content

@gokulkrishh
gokulkrishh / media-query.css
Last active May 8, 2024 06:59
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
/* CSS */
@staltz
staltz / introrx.md
Last active May 7, 2024 09:38
The introduction to Reactive Programming you've been missing
@CMCDragonkai
CMCDragonkai / ppi_and_dpi.sh
Last active May 4, 2024 08:22
CLI/X: Get the Real DPI/PPI of your Monitors/Display Devices on Linux
#!/usr/bin/env bash
# this will acquire the real PPI/DPI of the preferred/native mode of your monitors
# the DPI reported by `xdpyinfo` is not the real DPI, but your virtual DPI
# that may have been automatically calculated from the EDID information
# or manually set previously
# works in ZSH too
# requires xrandr, perl and bc
# in bc, only division respects scale, so we have to force a useless division
@chriskuehl
chriskuehl / fix-journalctl.md
Last active March 4, 2024 20:39
Fixing Ctrl-C in `less` when using systemd's `journalctl`

journalctl is the systemd tool for viewing and tailing system logs. It's cool but has one infuriating bug: when you hit ^C, it kills both journalctl and your pager. less has lots of useful behavior based on ^C (such as to stop tailing a log), so this makes journalctl practically useless in my view :)

It sets the K option on less which has this effect, but then it also sends SIGTERM itself when journalctl receives SIGINT, so unsetting that K is not effective, either.

Enter dumb-init

@Deraen
Deraen / edn.cljx
Last active August 6, 2023 06:51
Transit / edn date/datetime serialisers
(ns metosin.common.edn
#+clj
(:require [clj-time.format :as f])
#+cljs
(:require [cljs-time.format :as f]
cljs.reader)
#+clj (:import [org.joda.time DateTime LocalDate]))
;;
;; #DateTime tagging
@TheItachiUchiha
TheItachiUchiha / ToggleSwitch
Last active March 31, 2023 07:15
A simple Toggle Switch using JavaFX
import javafx.beans.property.SimpleBooleanProperty;
import javafx.geometry.Pos;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.layout.HBox;
public class ToggleSwitch extends HBox {
private final Label label = new Label();
@nic0lette
nic0lette / AudioFocusAwarePlayer.java
Last active November 15, 2022 09:39
A couple of classes (and an interface!) to make it easier to adapt to the audio focus changes that were introduced in Android Oreo.
/*
* Copyright 2017 Google Inc. All rights reserved.
*
* 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
@olekukonko
olekukonko / haproxy
Created August 8, 2013 21:30
Different websocket connection HA Proxy vs Nginx
#### HA Proxy
// PROXY BASED ON SUB-DOMAIN
frontend public
bind *:80
acl is_websocket hdr_end(host) -i ws.example.com
use_backend ws if is_websocket
default_backend www