Skip to content

Instantly share code, notes, and snippets.

@harfangk
harfangk / gist:7e7ec0005bb74e885b9f40c73ab4f1ca
Last active April 5, 2019 14:01
error log for syntax highlighter
➜ syntax-highlighting git:(master) ✗ cmake ./ && make && make test
Checking file [/usr/local/share/ECM/cmake/ECMConfig.cmake]
Checking file [/home/bonghyunkim/Qt5.10.0/5.10.0/gcc_64/lib/cmake/Qt5Core/Qt5CoreConfig.cmake]
Checking file [/home/bonghyunkim/Qt5.10.0/5.10.0/gcc_64/lib/cmake/Qt5Core/Qt5CoreConfig.cmake]
Chec
main :: IO ()
main = hakyll $ do
match "images/*" $ do
route idRoute
compile copyFileCompiler
match "css/*" $ do
route idRoute
compile compressCssCompiler
➜ haskell-ide-engine git:(master) cabal install Cabal
Resolving dependencies...
Configuring Cabal-2.4.1.0...
Failed to install Cabal-2.4.1.0
Build log ( /home/len/.cabal/logs/Cabal-2.4.1.0.log ):
cabal: Error: some packages failed to install:
Cabal-2.4.1.0 failed during the configure step. The exception was:
user error ('/usr/bin/ghc' exited with an error:
/tmp/cabal-tmp-2383/Cabal-2.4.1.0/Distribution/Parsec/ParseResult.hs:32:0:
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
defmodule Rps do
def run(input) do
if valid?(input) do
input
|> String.codepoints()
|> Enum.zip(challenge())
|> score()
|> print_result()
else
IO.puts("bad input")
type Request
= User User.Msg
| Room Room.Msg
type Endpoint
= User
| Room
type User.Msg
= Create UserPayload
@harfangk
harfangk / rich_hickey_fogus_interview.md
Last active December 22, 2018 21:51
Rich Hickey Interview with Fogus on CodeQuarterly (likely from around June 2011)

The original website containing this interview has disappeared. I've googled a bit to find this transcript. I'm saving it myself to provide another link to the great interview and preserve it.

Rich Hickey Q&A by Michael Fogus

Best known as the inventor of Clojure, a Lisp that runs on the Java Virtual Machine and the first new member of the Lisp family to attract any widespread interest since Scheme and Common Lisp, Rich Hickey has been a software developer and consultant for two decades.

Prior to starting work on Clojure, he made four attempts to combine Lisp with either Java or Microsoft’s Common Language Runtime: jfli, Foil, Lisplets, and DotLisp but Clojure was the first to draw significant attention. To date there have been four books published on Clojure, including The Joy of Clojure by interviewer Michael Fogus. The first Clojure conference, ClojureConj held in 2010, drew over two hundred attendees. And the Clojure Google group has, as of this writing, 4,880 members who have posted over 46,000 mes

web/static/js/video.js
=========================================================================================================
/***
* Excerpted from "Programming Phoenix",
* published by The Pragmatic Bookshelf.
* Copyrights apply to this code. It may not be used to create training material,
* courses, books, articles, and the like. Contact us if you are in doubt.
* We make no guarantees that this code is fit for any purpose.
* Visit http://www.pragmaticprogrammer.com/titles/phoenix for more book information.
***/
====================================================================================
new test:
test "converts unique_constraint on username to error" do
%User{}
|> User.registration_changeset(@valid_attrs)
|> Repo.insert!()
Repo.all(User)
|> IO.inspect()
attrs = Map.put(@test_attrs, :username, "user")
test/models/user_repo_test.ex
defmodule Storybook.UserRepoTest do
use Storybook.ModelCase
import Storybook.Factory
alias Storybook.User
@valid_attrs %{email: "email@test.com", username: "user", password: "password"}
@test_attrs %{email: "different_email@test.com", username: "different_user", password: "different_password"}