If you're thinking of checking out the Pony programming language, here's a list of things that I think are important to know. This list is based on a Tweet that I wrote.
There are Pony packages for several popular editors.
| # Add this file to your /etc/nixos/configuration.nix `imports = [ ... ];` attribute. | |
| # | |
| # After running `nixos-rebuild switch`, `systemctl --user start keybase-gui.service` | |
| # can be used to start the Keybase GUI. | |
| # | |
| # Not sure if it's just my tiling window manager, but there is a bit of wonkiness | |
| # with the tray icon. Other than that it works perfectly (as of 2017/11/22). | |
| { pkgs, ... }: |
| // This will open up a prompt for text to send to a console session on digital ocean | |
| // Useful for long passwords | |
| (function () { | |
| window.sendString = function (str) { | |
| f(str.split("")); | |
| function f(t) { | |
| var character = t.shift(); | |
| var i=[]; | |
| var code = character.charCodeAt(); | |
| var needs_shift = character.match(/[A-Z!@#$%^&*()_+{}:\"<>?~|]/); |
| Originally from: http://erlang.org/pipermail/erlang-questions/2017-August/093170.html | |
| For a safe and fast Erlang SSL server, there's a few | |
| configuration values you might want by default: | |
| [{ciphers, CipherList}, % see below | |
| {honor_cipher_order, true}, % pick the server-defined order of ciphers | |
| {secure_renegotiate, true}, % prevent renegotiation hijacks | |
| {client_renegotiation, false}, % prevent clients DoSing w/ renegs | |
| {versions, ['tlsv1.2', 'tlsv1.1']}, % add tlsv1 if you must |
If you're thinking of checking out the Pony programming language, here's a list of things that I think are important to know. This list is based on a Tweet that I wrote.
There are Pony packages for several popular editors.
| 1) Read an image from file | |
| 2) Display an image that you read from file | |
| 3) Capture Video using your webcam and display the feed | |
| 4) Display back and white live stream from your webcam. | |
| 5) Have a slider to change brightness of the webcam live stream. Display. | |
| 6) Have a slider to change contrast of the webcam live stream. Display. | |
| 7) Capture a snapshot from your webcam. Then display difference between live video stream and this snapshot. (Background subtraction) | |
| 8) Display Canny edge image from your live webcam stream | |
| 9) Have a slider to change smoothness / sharpness of image from live webcam stream. | |
| 10) Display histogram of colors (RGB) from your live webcam stream |
| #!/usr/bin/env bash | |
| LOG_PATH="/home/$(whoami)/log/speedtest.log" | |
| if result=$(/usr/bin/speedtest --simple); then | |
| parsed_result=$(printf "${result}\"" | sed ':a;N;$!ba;s/\n/" /g' | sed 's/: /="/g') | |
| printf "[$(date)] ${parsed_result}\n" >> "${LOG_PATH}" | |
| else | |
| printf "[$(date)] error\n" >> "${LOG_PATH}" | |
| exit 1 |
This is an example of how to pin the version of nixpkgs in a package repo. The goal is to improve reproducibility, make sure all the developers use the same version of nixpkgs and also allow to share binary caches.
Put all these files in a nixpkgs folder and then in other derivations, instead of import <nixpkgs> {} use import ./path/to/nixpkgs {}
If you want a run-down of the 1.3 changes and the design decisions behidn those changes, check out the LonestarElixir Phoenix 1.3 keynote: https://www.youtube.com/watch?v=tMO28ar0lW8
To use the new phx.new project generator, you can install the archive with the following command:
$ mix archive.install https://github.com/phoenixframework/archives/raw/master/phx_new.ez
Phoenix v1.3.0 is a backwards compatible release with v1.2.x. To upgrade your existing 1.2.x project, simply bump your phoenix dependency in mix.exs:
| module Main | |
| import Data.Vect | |
| -- %hide transpose | |
| dot : Num a => Vect n a -> Vect n a -> a | |
| dot va vb = foldr (+) 0 $ zipWith (*) va vb | |
| Matrix : (rows : Nat) -> (cols : Nat) -> Type -> Type |
| # unregister broken GHC packages. Run this a few times to resolve dependency rot in installed packages. | |
| # ghc-pkg-clean -f cabal/dev/packages*.conf also works. | |
| function ghc-pkg-clean() { | |
| for p in `ghc-pkg check $* 2>&1 | grep problems | awk '{print $6}' | sed -e 's/:$//'` | |
| do | |
| echo unregistering $p; ghc-pkg $* unregister $p | |
| done | |
| } | |
| # remove all installed GHC/cabal packages, leaving ~/.cabal binaries and docs in place. |