Skip to content

Instantly share code, notes, and snippets.

@sli
sli / datagrid.cljs
Created October 7, 2019 01:29
Datagrid Base
; 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 / blueprint-core.cljs
Last active October 3, 2019 03:40
Blueprint.js for 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 / telegramdark.user.js
Last active October 1, 2019 16:59
Telegram web dark mode
// ==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 / namegenerator.py
Created August 3, 2012 02:43
Quick and dirty dungeon name generator.
import random
NOUNS = [
'Tomb', 'Castle', 'Dungeon', 'Catacombs', 'Sewers', 'Mansion', 'Cave', 'Mines',
'Laboratory', 'Hobble', 'Prison', 'Asylum', 'Stockade', 'Vault', 'Reformatory',
'Oubliette', 'Sepulcher', 'Mausoleum', 'Pit', 'Crypt', 'Necropolis', 'Culverts',
'Grotto',
]
ADJECTIVES = [
@sli
sli / cool_image.cljs
Last active July 4, 2019 23:51
Chainable SVG library demo.
(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 June 8, 2019 23:34
DZ60RGB QMK Keymap
#pragma once
#define sli60
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 November 12, 2018 18:00
bubble sort
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 August 23, 2018 21:53
Some random, useless Elm shit that I just want to show to people.
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 August 15, 2017 23:55
Solder installer.
#!/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