Skip to content

Instantly share code, notes, and snippets.

View chrisschreiner's full-sized avatar

Chris Schreiner chrisschreiner

  • Schpaencoder
  • Oslo, Norway, Europe
View GitHub Profile
@chrisschreiner
chrisschreiner / APOD.swift
Last active June 25, 2018 10:33
Astronomy Picture of the Day with ReactiveCocoa 4
// APOD.swift
// Test with ReactiveCocoa 4
//
// Created by Chris Patrick Schreiner on 17-11-2015.
import ReactiveCocoa
import Result
import XCPlayground
XCPlaygroundPage.currentPage.needsIndefiniteExecution = true
@chrisschreiner
chrisschreiner / Main.elm
Created June 8, 2016 06:33 — forked from pdamoc/Main.elm
Req msg with cache
module Main exposing (..)
import Html exposing (..)
import Html.App as App
import Html.Events exposing (onClick)
import Req exposing (..)
import Dict exposing (Dict)
main : Program Never
parseKeyPress : Int -> Model -> ( Model, Cmd Msg )
parseKeyPress c model =
let
f =
case parseKey c of
Key1 ->
DebugTogglePadding
KeySpace ->
MakeMagicHappen
@chrisschreiner
chrisschreiner / .gitignore
Created May 15, 2016 17:46 — forked from zemm/.gitignore
Creative Commons license chooser widget in Elm
elm-stuff
var path = require('path');
var webpack = require('webpack');
var ExtractTextPlugin = require("extract-text-webpack-plugin");
module.exports = {
resolveLoader: {
root: __dirname + "/node_modules"
},
plugins: [
new webpack.ProvidePlugin({
module Main (..) where
import Maybe exposing (Maybe, withDefault)
import List exposing (head, length)
import Graphics.Collage as GC
import Graphics.Element as GE
import Graphics.Element
import Graphics.Collage exposing (rotate)
import Signal exposing (..)
import Mouse
port runner : Task Http.RawError ()
port runner = State.askForData q `Task.andThen` report
report : Http.Response -> Task x ()
report res =
Signal.send contentMailbox.address (toString res.value)
contentMailbox : Signal.Mailbox String
module Lifting (main) where
import Json.Decode as J
import Window
import Html
import Http
import Task
import Graphics.Element
import Color exposing (grayscale)
import Signal exposing(map)
///
- (ConfigureCellBlock)dimmedCell {
return [[^(UITableViewCell *cell) {
cell.backgroundColor = [self colorFor:@"sub.cell.background"];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
} copy] autorelease];
}
///
- (ConfigureBadgeBlock)standardBadge {
// log every category
[[L4Logger rootLogger] setLevel:[L4Level all]];
// send log messages to console
L4ConsoleAppender *consoleAppender=[[[L4ConsoleAppender alloc] initTarget:YES withLayout: [L4Layout simpleLayout]] autorelease];
[[L4Logger rootLogger] addAppender: consoleAppender];
L4Logger *theLogger = [L4Logger loggerForClass:[L4FunctionLogger class]];
[theLogger setLevel:[L4Level debug]];
//
log4Info(@"The logging system has been initialized.");