Skip to content

Instantly share code, notes, and snippets.

@didibus
didibus / user.clj
Created January 29, 2020 04:20
A Clojure user.clj file which lets you lazy load certain namespace at the REPL
(def safe-requires
"List of namespaces to require and refer when inside user ns at load time.
Can be given an initialization body to execute after having been required.
To do so, wrap the lib spec in a vector, and all elements after the lib
spec vector will be evaled after the lib spec has been required."
'[[clojure.repl :as repl :refer (source apropos dir pst doc find-doc)]
[clojure.java.javadoc :as javadoc :refer (javadoc)]
[clojure.pprint :as pprint :refer (pp pprint)]
[clojure.stacktrace :as stacktrace :refer (e)]
@dptsolutions
dptsolutions / dell-smm-hwmon.conf
Created September 29, 2019 18:00
dell-smm-hwmon.conf to force loading of dell-smm-hwmon module on "unsupported" Dell laptops (like XPS 13 9350)
#Force loading of the Dell Laptop SMM BIOS hwmon driver
options dell-smm-hwmon ignore_dmi=1 restricted=0 force=1
#Added ignore_dmi=1 per https://www.reddit.com/r/Dell/comments/9pdgid/configuring_the_xps_to_play_nice_with_linux/
#Added force=1 per https://askubuntu.com/questions/1094485/dell-xps-15-9570-how-to-control-the-fans
@jtlocsei
jtlocsei / mirror-and-remote-repl.md
Last active July 31, 2019 19:08
Edit and run code on remote server as if it's local with Clojure

Mirror + Clojure remote REPL

Motivation & summary

In a nutshell

Use mirror + clojure remote repl to edit and run clojure files on a server as if they're local.

What does it add beyond clojure remote REPL alone?

@BrodyCur
BrodyCur / gist:f650a181e67dec3bc78aac4673773583
Created June 20, 2019 20:43
Compound Interest Calculator
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Calculator</title>
</head>
<body>
<form>
<p>Starting Value: <input type="number" name="startingVal" id="startingVal"><br></p>
<p>Age: <select max="65" name="age" id="age"></select></p>
@zephraph
zephraph / clean_node_modules.sh
Last active June 13, 2023 13:53
A shell script to clean up all node_modules in projects that haven't been touched in a couple weeks.
#!/bin/bash
DAYS_SINCE_LAST_CHANGE=14 # If a project hasn't been touched in this long its node_modules will be deleted
SEARCH_PATH="./Git" # Update this to the path where your code is stored
TOTAL_BYTES_REMOVED=0
Mb=1000000
Kb=1000
node_modules=$(find $SEARCH_PATH -name "node_modules" -type d -prune)
@tednaleid
tednaleid / wexec.zsh
Last active August 10, 2019 21:28
wexec - shell function to allow easy iteration on a shell command, uses watchexec to re-run a command whenever the file is saved
# add to your .zshrc/.bashrc
# sets up "live reload"-like environment for for a single file
# will watch a file (create it if it doesn't exist), every time it is saved it will run a command
EDITOR=mvim # I use MacVim but switch this to whatever you use (something that'll be outside of the same terminal window)
function wexec() {
command -v watchexec >/dev/null 2>&1 || { echo "'watchexec' is required. e.g. brew install watchexec or cargo install watchexec" >&2; exit 1; }
if [[ -z $1 || "$1" == "--help" ]]; then
@yogthos
yogthos / reddit-video.cljs
Last active January 24, 2021 21:03
a Lumo script for downloading Reddit videos using youtube-dl
#!/usr/bin/env lumo
(ns reddit-video.core
(:require
[cljs.core :refer [*command-line-args*]]
[clojure.string :as string]))
(def https (js/require "https"))
(def process (js/require "child_process"))
(defn js->edn [data]
@anklos
anklos / rails_upgrade.md
Last active February 16, 2024 06:14
Rails upgrade from 4.2 to 5.2

Overall

This documents the upgrade from Rails 4.2 to 5.2 through four parts: Backend, Frontend, Infrascture and Checkboxes

Backend

Rails update task

Run rake command rails app:update, it creates a set of new configration files for active storage, action cable, content security policy etc. As we dont use these features, the default ones from code generation are kept.

@christoph-frick
christoph-frick / Awesome-Fennel.md
Last active March 1, 2024 19:42
Use fennel to write the awesome-wm config

How to write an awesome-wm config with Fennel

Awesome-WM is a X11 window manager, that is configured via Lua. Fennel is a Lisp for Lua. This shows a general setup of how to write your awesome-wm config using fennel directly without the compilation step (which would also work, but is not needed).

General setup

Fetch a recent Fennel version (the

@montanalow
montanalow / tour.sh
Last active October 14, 2018 17:34
$ cd my_app
$ lore python # launch python in my_app's virtualenv
$ lore pip # my_app's pip
$ lore console # my_app's ipython (installed in virtualenv)
$ lore notebook # my_app's jupyter notebook
$ lore lab # my_app's jupyter lab
$ lore exec # execute anything in my_app's virtualenv/bin/
$ lore env # see what else is in there
$ lore test # you do have unit tests, don't you?