Skip to content

Instantly share code, notes, and snippets.

View freakingawesome's full-sized avatar

Chad Gilbert freakingawesome

View GitHub Profile
" Settings
set noautofocus
set cncpcompletion
set nosmoothscroll
set nohud
set autohidecursor
set typelinkhints
let scrollduration = 10
let searchlimit = 40
/// <summary>
/// Obtain an interactive connection to a database inside redis using the default
/// database ID specified in the configuration.
/// </summary>
public IDatabase GetDefaultDatabase(object asyncState = null)
{
return GetDatabase(configuration.DefaultDatabase ?? 0, asyncState);
}
public static class ArgApplier
{
static T ChangeType<T>(object[] vals, int index)
{
if (vals == null || vals.Length <= index)
{
return default(T);
}
var val = vals[index];
env.RegisterHelper("cms_image", (writer, context, args) =>
{
// ArgApplier from https://gist.github.com/freakingawesome/5d94d14c1110aa174343
ArgApplier.Apply(args, (string name, int forceWidth, int forceHeight) =>
{
if (!string.IsNullOrWhiteSpace(name) && context.context.ContainsKey(name))
{
string src = context.context[name] as string;
// etc.
}
import Html exposing (..)
import Html.Events exposing (..)
import Html.Attributes exposing (..)
import StartApp
import Effects exposing (Never)
import Task
import Signal
app =
StartApp.start
import Signal
import Html exposing (..)
import Html.Events exposing (..)
type Action
= NoOp
type alias Model =
{ message : String }
import Signal
import Http
import Task
import Effects
import Html exposing (..)
import Html.Events exposing (..)
import Json.Decode
type Action
= NoOp
import Html exposing (..)
main =
let
line n =
div [] [ text <| "Line #" ++ (toString n) ]
in
div []
<| List.map line [0..100]
<html>
<body>
<script type="text/javascript" src="Main.js"></script>
<script type="text/javascript">
var app = Elm.fullscreen(Elm.Main, {
scrollTop: document.body.scrollTop
});
window.onscroll = function () {
app.ports.scrollTop.send(document.body.scrollTop);
import Html exposing (input, div, button, text, Html)
import Html.Events exposing (on, onClick, targetValue)
import Html.Attributes exposing (value, type')
import StartApp
import Task
import Signal.Time exposing (settledAfter)
import Time
import Effects exposing (Effects, Never)