Skip to content

Instantly share code, notes, and snippets.

View ericdallo's full-sized avatar
😌
Always coding

Eric Dallo ericdallo

😌
Always coding
View GitHub Profile
@scttnlsn
scttnlsn / debounce.cljs
Created March 24, 2014 17:03
core.async debounce
(defn debounce [in ms]
(let [out (chan)]
(go-loop [last-val nil]
(let [val (if (nil? last-val) (<! in) last-val)
timer (timeout ms)
[new-val ch] (alts! [in timer])]
(condp = ch
timer (do (>! out val) (recur nil))
in (recur new-val))))
out))
@Integralist
Integralist / 0. description.md
Last active June 17, 2023 21:49
Clojure deftype, defrecord, defprotocol
  • defprotocol: defines an interface
  • deftype: create a bare-bones object which implements a protocol
  • defrecord: creates an immutable persistent map which implements a protocol

Typically you'll use defrecord (or even a basic map);
unless you need some specific Java inter-op,
where by you'll want to use deftype instead.

Note: defprotocol allows you to add new abstractions in a clean way Rather than (like OOP) having polymorphism on the class itself,

Contributing

When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.

Pull Request Process

  1. Ensure any install or build dependencies are removed before the end of the layer when doing a
(into [:dl]
(map #(vector %1 %2) (cycle [:dt :dd]) (flatten (vec (clojure.walk/stringify-keys {:test "me" :foo "bar"})))))
;=> [:dl [:dt "test"] [:dd "me"] [:dt "foo"] [:dd "bar"]]
# `native-image` options
Output of `native-image.cmd --expert-options-all`, version 19.2.1.
```
-H:±AOTInline Perform method inlining in the AOT compiled native image. Default: + (enabled).
-H:AOTInliningDepthToSizeRate=2.5
-H:AOTInliningSizeMaximum=300
-H:AOTInliningSizeMinimum=50
-H:±AOTTrivialInline Perform trivial method inlining in the AOT compiled native image. Default: + (enabled).
@McCannDahl
McCannDahl / gist:a3cdde895ab1a758bffe8b5780c26ae5
Last active November 6, 2023 22:14
Raspberry Pi 3 in Monitoring Mode

Want to do some ethical hacking with only a Raspberry Pi 3?

No extra hardware required! Follow these steps:

  1. Download kali for raspberry pi & flash the OS onto the SD card
  2. iw phy phy0 interface add mon0 type monitor
  3. ifconfig mon0 up
    *alternatively try: airmon-ng start wlan0

To hack wifi

@Azeirah
Azeirah / setup-gitlab-for-magit-in-doom-emacs.md
Last active September 5, 2024 21:16
Setting up magit forge for gitlab in Doom Emacs

Magit forge for Gitlab in Doom Emacs

This guide assumes you're working on a Unix-like environment. I'm using Linux Mint (Ubuntu). It should work on Macs, and might on Windows.

These are the four steps you can use as a checklist, see the headings below for the details on each step.

  • Enable forge support
  • Create a Gitlab API key
  • Add your gitlab credentials to ~/.authinfo.gpg
  • Set-up forge in emacs
@didibus
didibus / clojure-right-tool.md
Last active October 24, 2024 09:00
When is Clojure "the right tool for the job"?

My answer to: https://www.reddit.com/r/Clojure/comments/pcwypb/us_engineers_love_to_say_the_right_tool_for_the/ which asked to know when and at what is Clojure "the right tool for the job"?

My take is that in general, the right tool for the job actually doesn't matter that much when it comes to programming language.

There are only a few cases where the options of tools that can do a sufficiently good job at the task become limited.

That's why they are called: General-purpose programming languages, because they can be used generally for most use cases without issues.

Let's look at some of the dimensions that make a difference and what I think of Clojure for them: