Docker can be used to avoid having to install Ruby and all the dependencies locally.
Clone the project first, and navigate into your clone:
$ git clone https://github.com/jneen/rouge.git
$ cd rouge
### | |
### [2023-06-19] UPDATE: Just tried to use my instructions again on a fresh install and it failed in a number of places. | |
###. Not sure if I'll update this gist (though I realise it seems to still have some traffic), but here's a list of | |
###. things to watch out for: | |
### - Check out the `nix-darwin` instructions, as they have changed. | |
### - There's a home manager gotcha https://github.com/nix-community/home-manager/issues/4026 | |
### | |
# I found some good resources but they seem to do a bit too much (maybe from a time when there were more bugs). | |
# So here's a minimal Gist which worked for me as an install on a new M1 Pro. |
Docker can be used to avoid having to install Ruby and all the dependencies locally.
Clone the project first, and navigate into your clone:
$ git clone https://github.com/jneen/rouge.git
$ cd rouge
nix-channel
and ~/.nix-defexpr
are gone. We'll use $NIX_PATH
(or user environment specific overrides configured via nix set-path
) to look up packages. Since $NIX_PATH
supports URLs nowadays, this removes the need for channels: you can just set $NIX_PATH
to e.g. https://nixos.org/channels/nixos-15.09/nixexprs.tar.xz
and stay up to date automatically.
By default, packages are selected by attribute name, rather than the name
attribute. Thus nix install hello
is basically equivalent to nix-env -iA hello
. The attribute name is recorded in the user environment manifest and used in upgrades. Thus (at least by default) hello
won't be upgraded to helloVariant
.
@vcunat suggested making this an arbitrary Nix expression rather than an attrpath, e.g. firefox.override { enableFoo = true; }
. However, such an expression would not have a key in the user environment, unlike an attrpath. Better to require an explicit flag for this.
TBD: How to deal with search path clashes.
#!/usr/bin/env python | |
# | |
# Adds the ability to add / modify tasks using a "blocks:" attribute, | |
# the opposite of "depends:". | |
# | |
# This script acts as an on-modify, on-add and on-launch hook at the same time. | |
# | |
### SETUP | |
# Save this file as | |
# ~/.task/hooks/on-modify.blocks_attr.py |
People
:bowtie: |
😄 :smile: |
😆 :laughing: |
---|---|---|
😊 :blush: |
😃 :smiley: |
:relaxed: |
😏 :smirk: |
😍 :heart_eyes: |
😘 :kissing_heart: |
😚 :kissing_closed_eyes: |
😳 :flushed: |
😌 :relieved: |
😆 :satisfied: |
😁 :grin: |
😉 :wink: |
😜 :stuck_out_tongue_winking_eye: |
😝 :stuck_out_tongue_closed_eyes: |
😀 :grinning: |
😗 :kissing: |
😙 :kissing_smiling_eyes: |
😛 :stuck_out_tongue: |
(use '[clojure.core.match :only [match]]) | |
(defn evaluate [env [sym x y]] | |
(match [sym] | |
['Number] x | |
['Add] (+ (evaluate env x) (evaluate env y)) | |
['Multiply] (* (evaluate env x) (evaluate env y)) | |
['Variable] (env x))) | |
(def environment {"a" 3, "b" 4, "c" 5}) |
def Secured[A](username: String, password: String)(action: Action[A]) = Action(action.parser) { request => | |
request.headers.get("Authorization").flatMap { authorization => | |
authorization.split(" ").drop(1).headOption.filter { encoded => | |
new String(org.apache.commons.codec.binary.Base64.decodeBase64(encoded.getBytes)).split(":").toList match { | |
case u :: p :: Nil if u == username && password == p => true | |
case _ => false | |
} | |
}.map(_ => action(request)) | |
}.getOrElse { | |
Unauthorized.withHeaders("WWW-Authenticate" -> """Basic realm="Secured"""") |