Skip to content

Instantly share code, notes, and snippets.

@sli
sli / gitlab-firacode.user.js
Last active Dec 6, 2019
A userscript to enable ligatures (using Fira Code) on <code> blocks and Monaco Editors.
View gitlab-firacode.user.js
// ==UserScript==
// @name Browser Fira Code
// @version 1
// @grant none
// ==/UserScript==
const GM_addCssResource = href => {
const head = document.getElementsByTagName('head')[0]
if (!head) { return }
View datagrid.cljs
; https://github.com/borkdude/draggable-button-in-reagent/blob/master/src-cljs/drag/main.cljs
(def columns
[{:key :one :display "One"}
{:key :two :display "Two"}
{:key :three :display "Three"}
{:key :four :display "Four"}
{:key :five :display "Five"}])
(def cell-renderers
@sli
sli / telegramdark.user.js
Last active Oct 1, 2019
Telegram web dark mode
View telegramdark.user.js
// ==UserScript==
// @name Telegram dark theme / night mode
// @namespace https://github.com/digitalheir/
// @version 1.0
// @description Dark theme / night mode for Telegram Web
// @author Maarten Trompper <maartentrompper@freedom.nl>
// @match https://web.telegram.org/*
// ==/UserScript==
// Since GM removed it (https://wiki.greasespot.net/GM_addStyle)
@sli
sli / blueprint-core.cljs
Last active Oct 3, 2019
Blueprint.js for CLJS
View blueprint-core.cljs
(ns beard-oil.lib.blueprint.core
(:require ["@blueprintjs/core" :as bpc]
[camel-snake-kebab.core :refer [->kebab-case-keyword]]
[camel-snake-kebab.extras :refer [transform-keys]]))
(def ^:private constant
(comp
(partial transform-keys ->kebab-case-keyword)
js->clj))
@sli
sli / cool_image.cljs
Last active Jul 4, 2019
Chainable SVG library demo.
View cool_image.cljs
(ns svg.core
(:require [reagent.core :refer [render-component]]
[svg.lib.core :as s]))
(def sand-color "#efc58d")
(defn cool-image
[]
(-> (s/svg {:view-box "0 0 100 100"
:stroke "none"
@sli
sli / config.h
Last active Jun 8, 2019
DZ60RGB QMK Keymap
View config.h
#pragma once
#define sli60
View caller.js
const handler = {
get: (obj, prop) => {
// Call should be run when calling invoke().
if (prop === 'invoke') {
return body => console.log(`Would call ${obj.route} with body: ${JSON.stringify(body)}`)
}
// First access sets the request method.
if (obj.route === null) {
return (new Proxy({ route: '', method: prop }, handler))
@sli
sli / sortAnything.js
Last active Nov 12, 2018
bubble sort
View sortAnything.js
const makeCourse = (code, name) => ({ code, name })
const makeHonors = (course, section, semester) => ({ course, section, semester })
const courses = [
makeCourse(220, 'D Two Two Zero'),
makeCourse(110, 'A One One Zero'),
makeCourse(130, 'C One Three Zero'),
makeCourse(120, 'B One Two Zero')
]
@sli
sli / Main.elm
Created Aug 23, 2018
Some random, useless Elm shit that I just want to show to people.
View Main.elm
import Html exposing (Html, Attribute, text, program, section, div, button, input, label)
import Html.Events exposing (onClick)
import Html.Attributes exposing (class, type_, placeholder)
type alias Todo =
{ id : Int
, description : String
, done : Bool
}
type alias Model = { todos : List Todo }
@sli
sli / solder-install.sh
Created Aug 15, 2017
Solder installer.
View solder-install.sh
#!/bin/bash
# Get root if needed
if [ "$EUID" -ne 0 ]
echo This script must be run as root. Enter root password to continue.
sudo su
fi
# Install most things
dnf install vim git nginx mariadb-server mariadb php php-cli php-curl php-mcrypt php-apcu php-fpm
You can’t perform that action at this time.