This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { default as htm } from 'htm'; | |
import { RouterLink, RouterView } from 'vue-router'; | |
import { ref, h } from 'vue'; | |
// A component with something like: | |
// | |
// export default { | |
// setup(_props, { slots }) { | |
// return () => h('div', slots.default()); | |
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns spacedl.spacedl | |
(:require [clojure.string :as string :refer [join starts-with?]])) | |
(.on js/process "uncaughtException" #(js/console.error %)) | |
(defonce http (js/require "http")) | |
(defonce https (js/require "https")) | |
(defonce fs (js/require "fs")) | |
(defn page [gallery-url page-number] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env lumo | |
(ns spacedl.spacedl | |
(:require [cljs.nodejs :as node] | |
[clojure.pprint :refer [pprint]] | |
[clojure.string :as string :refer [join split starts-with?]] | |
[cljs.core :refer [*command-line-args*]])) | |
(node/enable-util-print!) | |
(.on js/process "uncaughtException" #(js/console.error %)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# syntax=docker/dockerfile:1 | |
FROM ubuntu:22.04 | |
# Update and install essentials. | |
RUN apt-get update | |
RUN apt-get install -y wget git tmux ripgrep curl unzip neovim less xz-utils fontconfig | |
RUN fc-cache -f -v | |
# Portacle. | |
WORKDIR /home/linus |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/usr/local/bundle/gems/ffi-1.15.5/lib/ffi/library.rb:145:in `block in ffi_lib': | |
Could not open library 'vips.so.42': vips.so.42: cannot open shared object file: No such file or directory. (LoadError) | |
Could not open library 'libvips.so.42': libvips.so.42: cannot open shared object file: No such file or directory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns ^:figwheel-hooks dynamic-css.core | |
(:require | |
[goog.dom :as gdom] | |
[goog.style :as gstyle] | |
[reagent.core :as r] | |
[reagent.dom :as rdom] | |
[garden.core :refer [css]]) | |
(:import [goog.html SafeStyleSheet] | |
[goog.string Const])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Using goog.ui.KeyboardShortcutHandler with ClojureScript to support keyboard input events (for example, to create shortcuts). | |
;; Documentation about goog.ui.KeyboardShortcutHandler: | |
;; https://github.com/google/closure-library/blob/master/closure/goog/demos/keyboardshortcuts.html | |
(ns example.detect-keyboard-effects | |
(:require [goog.events :as events]) | |
(:import [goog.ui KeyboardShortcutHandler])) | |
(defn setup-keyboard-shortcuts [] | |
(let [shortcuts (KeyboardShortcutHandler. js/document)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This can be used to load images when you don't know their sizes beforehand. | |
imageView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { | |
@Override | |
public void onGlobalLayout() { | |
// Need to remove the listener, otherwise weird things will happen. | |
if (Build.VERSION.SDK_INT < 16) { | |
imageView.getViewTreeObserver().removeGlobalOnLayoutListener(this); | |
} else { | |
imageView.getViewTreeObserver().removeOnGlobalLayoutListener(this); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This improved version of the prompt shows the return value of the last command, | |
# what time the command was run, the git branch name and status if in a repo folder | |
# and the working directory as usual. | |
# Source the ANSI color codes before sourcing this file, otherwise it won't work. | |
get_git_branch() { | |
local branch | |
if branch=$(git rev-parse --abbrev-ref HEAD 2> /dev/null); then | |
if [[ "$branch" == "HEAD" ]]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Set Ctrl-a as the default prefix key combination and unbind Ctrl-b. | |
set -g prefix C-a | |
unbind C-b | |
# Change default delay time. | |
set -sg escape-time 1 | |
# Change base index to 1 (in status bar and panes). | |
set -g base-index 1 | |
setw -g pane-base-index 1 |
NewerOlder