Skip to content

Instantly share code, notes, and snippets.

View peter-kehl's full-sized avatar
🏠
Working from home

Peter Kehl peter-kehl

🏠
Working from home
View GitHub Profile
@RubenKelevra
RubenKelevra / fast_firefox.md
Last active April 26, 2024 21:30
Make Firefox fast again
@peter-kehl
peter-kehl / rust_const_generics.md
Last active March 28, 2024 15:07
Rust Const Generics

Presentation on Const Generics as of 1.50.0 stable and 1.52.0-nightly

Challenges

  • Beware no, or misleading, documentation
  • Syntax may seem arbitrary:
    • Need ::< turbofish at some places, ordinary < elsewhere.
    • Need {...} curly brackets around some const generic parameter values, not around others.
    • Some error messages feel like going in circles.
@peterhs73
peterhs73 / virtualenv_n_jupyter_kernel.md
Last active February 23, 2024 17:37
Python Virtual Environments and Jupyter Notebook Kernel Guide

Create Python Virtual Environment and Install iPython Kernel for researchers working with Jupyter notebooks.

TL;DR

  • Virtual Environment
    • Virtualenv
      virtualenv env_to_create  
      \folder_to_create\Scripts\activate
      
@okitavera
okitavera / userChrome.css
Created January 24, 2018 12:09
Custom userChrome.css for firefox 57 for auto-hiding the navigation bar and bookmark bar
/* Auto-hide toolbar */
:root[uidensity=compact] #navigator-toolbox {
--nav-bar-height: 33px;
}
:root:not([uidensity]) #navigator-toolbox {
--nav-bar-height: 39px;
}
:root[uidensity=touch] #navigator-toolbox {
@hallettj
hallettj / userChrome.css
Last active June 23, 2023 18:05
Customize Firefox Quantum to hide tab bar, and to hide navigation bar when it is not focused. Press Ctrl+L to reveal navigation bar. To make this work you must open about:config and set toolkit.legacyUserProfileCustomizations.stylesheets to true with. This version is tested with Firefox v78.
@-moz-document url(chrome://browser/content/browser.xul),
url(chrome://browser/content/browser.xhtml) {
/* hide horizontal tabs at the top of the window */
#TabsToolbar > * {
visibility: collapse;
}
/* hide navigation bar when it is not focused; use Ctrl+L to get focus */
#main-window:not([customizing]) #navigator-toolbox:not(:focus-within):not(:hover) {
@Noitidart
Noitidart / _git-submodule-tips.md
Last active March 29, 2024 22:43
Tips for working with git submodules

Tips for Working With git Submodules

Cloning Repo with Submodules

  1. Use the --recursive flag:

     git clone https://github.com/aikiframework/json.git --recursive
    

    However if you cannot, as Github desktop app on clone does not use this flag, then do this after clone:

@levand
levand / cider-opinions.md
Last active November 20, 2023 07:50
Why I don't use cider

Why I don't use cider.

This is all personal opinion and a matter of taste. I'm putting it here because people have asked - I'm glad Cider exists and that a lot of people are obviously using it to great effect. This is not an attack on Cider or a an attempt to negate the experience of those who like it, just my own experience.

Also some of the critiques are more properly aimed at nRepl than Cider - I don't use nRepl either, in Emacs. For some reason I have fewer issues with it in Cursive (though I still do have some).

  1. With Cider, there's too much "going on" between Emacs and Clojure. When something glitches, hangs, doesn't return a value, throws an excption, etc (as it does, multiple times a day), I don't know whether the problem is in Emacs, in the Cider client, the nRepl server, one of any of the default middlewares or in my actual program. I run Emacs in inferior lisp using lein trampoline -m clojure.main - if something goes wrong, it's either in Emacs (which is usually obvious) or my program. Mi
(require '[clojure.core.async :as a])
(def xform (comp (map inc)
(filter even?)
(dedupe)
(flatmap range)
(partition-all 3)
(partition-by #(< (apply + %) 7))
(flatmap flatten)
(random-sample 1.0)
@john2x
john2x / 00_destructuring.md
Last active April 23, 2024 13:18
Clojure Destructuring Tutorial and Cheat Sheet

Clojure Destructuring Tutorial and Cheat Sheet

(Related blog post)

Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.

Vectors and Sequences

@Chaser324
Chaser324 / GitHub-Forking.md
Last active April 25, 2024 04:57
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j