An overview of algebraic laws from the perspective of a functional programmer. I've used a Haskell-esque syntax for the definitions of the laws and examples.
name | definition | example |
---|---|---|
Identity [¹][] | f x = x |
add 0 42 = 42 |
This is a proposal for a "lure service".
While this can serve as the foundation for countless features, the primary goal is to solve the "boot into an empty landscape" problem. In other words, it's trying to close the loop of "one person uses Urbit" -> "they invite another to their group on Urbit" -> "they get on Urbit and immediately know what to do with it" -> "they invite another".
Thus, we will first consider the case of inviting someone into an Urbit group who may not already use Urbit.
Invites should be regular links. These work on any device, can be transmitted over any transport (including publicly in a tweet or physically via qr code), and are very low-friction to click. When you click this link, you should expect to receive an invite to that group.
To make this happen, we must somehow establish an association between the person who clicked the link and their @p. We should make this work for as many cases as possible -- especially, it should work even if they don't yet have a @p.
How to pad out 80-ish column plain text documents such that they're placed in the center of a much wider terminal (or other application window), for better readability.
Simplest CSS that could possibly work, assuming an 80-column plain text document. Requires Stylus or a similar browser extension. I use "URLs matching the regexp" .*\.(|TXT|txt|rst|md|ME|me)$
.
Process goes something like this:
bundle update webpacker
rails webpacker:binstubs
yarn upgrade @rails/webpacker@4.0.0-pre.2 # or 'add' instead of upgrade
yarn upgrade webpack-dev-server@"'3.1.4' # or 'add' instead of upgrade
yarn add webpack-cli
bundle exec rails webpacker:install # don't do this! the scrpit seems to overwrite the @rails/webpacker version to 3.5.3
Make sure you have port 8080 (or whatever you use) open on the remote machine!! Don't be like Vinney.
I'm no webpack expert (in fact this is the first project I've set up by hand ever...), but if you know what you're doing you should be able to change the relevant parts of this to fit your project:
# webpack.config.js
module.exports = {
plugins: | |
postcss-import: {} | |
postcss-cssnext: {} | |
tailwindcss: "./app/javascript/src/tailwind.js" |
Vim provides built-in mechanisms to search through projects in the form of the grep
command.
However, on large projects, grep is known to be slow; and hence people have been switching to simpler searchers like ack, and faster, parallel (metal?) searchers like ag and pt.
Correspondingly, several plugins have been created that integrate these tools in vim: ack.vim, ag.vim, etc.
However, it's actually very easy to get the functionalities these plugins provide (faster search, results in quickfix-window, jumps, previews, and so on) in vanilla Vim itself; in fact, Vim already populates the grep-search results in a quickfix window. We just need to tell Vim to do the following things (use-case: ag):
For me the perfect developer (if there is such a person) has these qualities:
It's important to note that running this reset will drop any existing data you have in the application
heroku restart
heroku pg:reset DATABASE
(no need to change the DATABASE
)heroku run rake db:migrate
heroku run rake db:seed
(if you have seed)One liner
#!/bin/bash | |
# if spotify is started | |
if [ "$(pidof spotify)" ]; then | |
# status can be: Playing, Paused or Stopped | |
status=`dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'PlaybackStatus'|egrep -A 1 "string"|cut -b 26-|cut -d '"' -f 1|egrep -v ^$` | |
artist=`dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'Metadata'|egrep -A 2 "artist"|egrep -v "artist"|egrep -v "array"|cut -b 27-|cut -d '"' -f 1|egrep -v ^$` | |
album=`dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'Metadata'|egrep -A 1 "album"|egrep -v "album"|cut -b 44-|cut -d '"' -f 1|egrep -v ^$` | |
title=`dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 o |