Skip to content

Instantly share code, notes, and snippets.

View jcf's full-sized avatar
❤️

James Conroy-Finn jcf

❤️
View GitHub Profile
@jcf
jcf / AAA-README.md
Created August 15, 2021 18:02 — forked from jackrusher/AAA-README.md
Clojure + FUSE

Meld

A minimal example of creating a (mostly) working FUSE filesystem using Clojure. NOTE: I have only tested this with OSX, and it assumes you have already installed libfuse.

Trying it out

Create an empty directory at /tmp/meld to serve as your mount point, put these files in a directory called meld, then:

@jcf
jcf / chromium-profile-3.desktop
Created April 24, 2020 17:34
Chromium "desktop" with explicit profile
[Desktop Entry]
Version=1.0
Name=Chromium
Exec=/usr/bin/chromium --profile-directory='Profile 3' %U
StartupNotify=true
Terminal=false
Icon=chromium
Type=Application
Categories=Network;WebBrowser;
MimeType=application/pdf;application/rdf+xml;application/rss+xml;application/xhtml+xml;application/xhtml_xml;application/xml;image/gif;image/jpeg;image/png;image/webp;text/html;text/xml;x-scheme-handler/ftp;x-scheme-handler/http;x-scheme-handler/https;
@jcf
jcf / myapp.yml
Created January 7, 2020 12:42
Test your Clojure project with test-runner, clj-kondo and GitHub's actions!
---
name: myapp
on: [push]
jobs:
test:
runs-on: ubuntu-latest
steps:
(defun eshell/j (&rest query)
(require 's)
(let* ((fasd (executable-find "fasd"))
(matches (thread-last (s-join " " query)
(format "%s -ld %s" fasd)
(shell-command-to-string)
(s-trim)
(s-lines)
(mapcar 's-trim))))
(message "Matches: %s" matches)
@jcf
jcf / maven-fastly-error.txt
Created November 13, 2017 18:03
Looks like someone has messed up the Maven certs pushed out by Fastly.
Could not transfer artifact com.cognitect:transit-cljs:pom:0.8.243 from/to central (https://repo1.maven.org/maven2/): hostname in certificate didn't match: <repo1.maven.org> != <a.ssl.fastly.net> OR <a.ssl.fastly.net> OR <*.a.ssl.fastly.net> OR <fast.wistia.com> OR <purge.fastly.net> OR <mirrors.fastly.net> OR <*.parsecdn.com> OR <*.fastssl.net> OR <voxer.com> OR <www.voxer.com> OR <*.firebase.com> OR <sites.yammer.com> OR <sites.staging.yammer.com> OR <*.skimlinks.com> OR <*.skimresources.com> OR <cdn.thinglink.me> OR <*.fitbit.com> OR <*.hosts.fastly.net> OR <control.fastly.net> OR <*.wikia-inc.com> OR <*.perfectaudience.com> OR <*.wikia.com> OR <f.cloud.github.com> OR <*.digitalscirocco.net> OR <*.etsy.com> OR <*.etsystatic.com> OR <*.addthis.com> OR <*.addthiscdn.com> OR <fast.wistia.net> OR <raw.github.com> OR <www.userfox.com> OR <*.assets-yammer.com> OR <*.staging.assets-yammer.com> OR <assets.huggies-cdn.net> OR <orbit.shazamid.com> OR <about.jstor.org> OR <*.global.ssl.fastly.net> OR <web.voxer.com>
= Arch Linux step-by-step installation =
= http://blog.fabio.mancinelli.me/2012/12/28/Arch_Linux_on_BTRFS.html =
== Boot the installation CD ==
== Create partition ==
cfdisk /dev/sda
* Create a partition with code 8300 (Linux)
@jcf
jcf / datomic_pull_spec.clj
Created March 31, 2017 17:20
In a couple of minutes I've got a first version of validating pull syntax via clojure.spec?!
(s/def ::attr-name
qualified-keyword?)
(s/def ::recursion-limit
(s/or :num pos-int?
:str #{"..."}))
(s/def ::wildcard
(s/or :str #{"*"}
:sym #{'*}))
@jcf
jcf / onyx.clj
Created February 9, 2017 16:52
Slurp the contents of your Onyx log into memory
(defn slurp-log
([peer-client-config] (slurp-log peer-client-config 2000))
([peer-client-config wait]
(let [chan (clojure.core.async/chan)
sub (onyx.api/subscribe-to-log peer-client-config chan)
timeout (clojure.core.async/timeout wait)
xs (clojure.core.async/<!!
(clojure.core.async/go-loop [xs []]
(let [[val ch] (clojure.core.async/alts! [chan timeout])]
(if (= ch timeout)
@jcf
jcf / gist:141cba67d8df2457aac7c68d80272cc0
Created December 22, 2016 14:26 — forked from mfilippov/gist:10009192
Netty multicast demo.
package me.filippov.netty_demo;
import io.netty.bootstrap.Bootstrap;
import io.netty.bootstrap.ChannelFactory;
import io.netty.channel.*;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.DatagramPacket;
import io.netty.channel.socket.InternetProtocolFamily;
import io.netty.channel.socket.nio.NioDatagramChannel;
@jcf
jcf / VAAPI-hwaccel-encode-Linux-Ffmpeg&Libav-setup.md
Created November 6, 2016 19:53 — forked from Brainiarc7/VAAPI-hwaccel-encode-Linux-Ffmpeg&Libav-setup.md
This gist contains instructions on setting up FFmpeg and Libav to use VAAPI-based hardware accelerated encoding (on supported platforms) for H.264 (and H.265 on supported hardware) video formats.

Using VAAPI's hardware accelerated video encoding on Linux with Intel's hardware on FFmpeg and libav

Hello, brethren :-)

As it turns out, the current version of FFmpeg (version 3.1 released earlier today) and libav (master branch) supports full H.264 and HEVC encode in VAAPI on supported hardware that works reliably well to be termed "production-ready".