Skip to content

Instantly share code, notes, and snippets.

Avatar
☮️

James Conroy-Finn jcf

☮️
View GitHub Profile
@jcf
jcf / AAA-README.md
Created Aug 15, 2021 — forked from jackrusher/AAA-README.md
Clojure + FUSE
View AAA-README.md

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 Apr 24, 2020
Chromium "desktop" with explicit profile
View chromium-profile-3.desktop
[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 Jan 7, 2020
Test your Clojure project with test-runner, clj-kondo and GitHub's actions!
View myapp.yml
---
name: myapp
on: [push]
jobs:
test:
runs-on: ubuntu-latest
steps:
View fasd-eshell.el
(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 Nov 13, 2017
Looks like someone has messed up the Maven certs pushed out by Fastly.
View maven-fastly-error.txt
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>
View Arch Linux step-by-step installation on btrfs
= 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 Mar 31, 2017
In a couple of minutes I've got a first version of validating pull syntax via clojure.spec?!
View datomic_pull_spec.clj
(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 Feb 9, 2017
Slurp the contents of your Onyx log into memory
View onyx.clj
(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)
View gist:141cba67d8df2457aac7c68d80272cc0
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 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.
View VAAPI-hwaccel-encode-Linux-Ffmpeg&Libav-setup.md

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".