Skip to content

Instantly share code, notes, and snippets.

View julianjelfs's full-sized avatar
🦥
Reclining

Julian Jelfs julianjelfs

🦥
Reclining
View GitHub Profile
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@julianjelfs
julianjelfs / gist:cab12ba4206679bc6cde5f580ac844f5
Created April 5, 2017 09:23
Remote data responding to error
ResultsReceived data ->
( { model | data = data }
, Cmd.none
)
ResultsReceived (Failure err) ->
( { model | data = (Failure err)}
, systemError (toString err)
)
RetrievedTenants result ->
case result of
Ok tenants ->
(tenants, Cmd.none)
Err error ->
let
msg = toString error
fx = Signal.send model.showErrorsAddress msg
|> Effects.task
|> Effects.map TaskDone
import Html exposing (..)
import Html.Attributes exposing(..)
import Html.Events exposing(..)
import Html.App as Html exposing(..)
--MODEL
type alias Model = {
blueClicks : Int,
redClicks : Int,
greenClicks : Int
$http.get('url').then(notifications => {
return _.map(notifications, n => {
let templates = {
1 : `/desktop/${n.Name}/${n.SomeId}`,
2 : `/desktop/${n.Whatever}/${n.SomethingElse}`
};
return {
text : n.Text,
route : templates[n.Type]
}
(defn relative-to [prev next]
(if prev
(let [[pr pc] prev
[nr nc] next]
[(+ pr nr) (+ pc nc)])
next))
(defn tetrominos
"all tetrominos start at [0 0]"
([] (tetrominos [[0 0]]))
@julianjelfs
julianjelfs / gist:47edb7be50ca6d43c22a
Created November 29, 2014 19:56
kpm restore error
Out of memory
Stacktrace:
at <unknown> <0xffffffff>
at (wrapper managed-to-native) object.__icall_wrapper_mono_gc_alloc_vector (intptr,intptr,intptr) <0xffffffff>
at (wrapper alloc) object.AllocVector (intptr,intptr) <0xffffffff>
at Mono.Security.X509.X509Store.Load (string) <0x00068>
at Mono.Security.X509.X509Store.LoadCertificate (string) <0x00037>
at Mono.Security.X509.X509Store.BuildCertificatesCollection (string) <0x00107>
at Mono.Security.X509.X509Store.get_Certificates () <0x00023>
@julianjelfs
julianjelfs / gist:cc3ffc17b61b16bf89c9
Created November 28, 2014 21:35
asp.Net vNext project.json file
{
"version": "0.1-alpha-*",
"dependencies": {
"Microsoft.AspNet.Diagnostics": "1.0.0-*",
"Microsoft.AspNet.Hosting": "1.0.0-*",
"Microsoft.AspNet.Mvc": "6.0.0-*",
"Microsoft.AspNet.Server.WebListener": "1.0.0-*",
"Kestrel": "1.0.0-*"
},
"commands": {
@julianjelfs
julianjelfs / gist:d7d9f52815f731a7138d
Created November 28, 2014 07:51
Ctrl+B error from inside Sublime 3
/home/julianj/.config/sublime-text-3/Packages/Kulture/build.sh: 354: /home/julianj/.kre/kvm/kvm.sh: Syntax error: "(" unexpected (expecting ";;")
[Finished in 0.0s with exit code 2]
[cmd: ['sh', '/home/julianj/.config/sublime-text-3/Packages/Kulture/build.sh']]
[dir: /home/julianj/Projects/vNext/Home/samples/HelloMvc]
[path: /home/julianj/Applications/leiningen:/home/julianj/Applications/mongodb/mongodb-linux-x86_64-2.6.4/bin:/home/julianj/Applications/sbt/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games]
@julianjelfs
julianjelfs / gist:95ba2f456c58363bfb1b
Created November 28, 2014 07:49
k run error on ubuntu 14.04 with asp.net vNext HelloMvc
Microsoft.Framework.Runtime.Roslyn.RoslynCompilationException: /home/julianj/Projects/vNext/Home/samples/HelloMvc/Startup.cs(9,31): error CS0246: The type or namespace name 'IBuilder' could not be found (are you missing a using directive or an assembly reference?)
at Microsoft.Framework.Runtime.Roslyn.RoslynProjectReference.Load (IAssemblyLoadContext loadContext) [0x00000] in <filename unknown>:0
at Microsoft.Framework.Runtime.Loader.ProjectAssemblyLoader.Load (System.String name, IAssemblyLoadContext loadContext) [0x00000] in <filename unknown>:0
at Microsoft.Framework.Runtime.Loader.ProjectAssemblyLoader.Load (System.String name) [0x00000] in <filename unknown>:0
at klr.host.LoaderContainer.Load (System.String name) [0x00000] in <filename unknown>:0
at klr.hosting.RuntimeBootstrapper+<>c__DisplayClasse.<ExecuteAsync>b__4 (System.Reflection.AssemblyName assemblyName) [0x00000] in <filename unknown>:0
at klr.hosting.RuntimeBootstrapper+<>c__DisplayClasse.<ExecuteAsync>b__7 (System.Object send