Skip to content

Instantly share code, notes, and snippets.

View davejlong's full-sized avatar

David Long davejlong

View GitHub Profile
@davejlong
davejlong / brunch-config.js
Created May 25, 2017 15:34
Example brunch-config.js to load SimpleMDE into Phoenix
exports.config = {
// See http://brunch.io/#documentation for docs.
files: {
javascripts: {
joinTo: {
"js/app.js": /^(web\/static\/js\/frontend)|(node_modules)/,
"js/admin.js": /^(web\/static\/js\/admin)|(node_modules)/,
"js/ex_admin_common.js": ["web/static/vendor/ex_admin_common.js"],
"js/admin_lte2.js": ["web/static/vendor/admin_lte2.js"],
"js/jquery.min.js": ["web/static/vendor/jquery.min.js"]
@davejlong
davejlong / README.md
Created March 17, 2017 19:24
Kitto Comment Widget

Comment Widget for Kitto

This package includes a widget for displaying comment style text in a dashboard.

Install

  1. Install into your dashboard with mix kitto.install --gist ee402159c3c4770ee06f6e12a220cb35
  2. Create a job to export data with the following format:
@davejlong
davejlong / README.md
Last active March 28, 2017 04:49
Forecast widget and job for Kitto

Forecast Widget and Job Powered By Forecast.io

This package includes a job to pull forecasts from the Forecast.io API and a widget to display the forecast information.

Install

  1. Install into your dashboard with mix kitto.install --gist 229b76b15eae45ee9f5cc1e5d62a40eb
  2. Register for a DarkSky API key and set it into your applications environment in config/config.exs:
defmodule Uebersample.Router do
use Plug.Router
plug Ueberauth
alias Ueberauth.Strategy.Helpers
plug :match
plug :dispatch
get "/hello" do

JIRA Kitto Plugin

Adds the ability to display lists of issues or a count of issues for filters from JIRA. The plugin is composed of 2 parts:

  • JIRA Job - A Kitto job definition
  • JIRA Table Widget - A Kitto widget for displaying JIRA issues in a table

Installation

  1. Install into your dashboard with mix kitto.install --gist e2adb6e2f301672500d4b13e0a9a7de2
---
driver:
name: docker
provisioner:
name: chef_solo
platforms:
- name: centos-7.2
driver_config:
@davejlong
davejlong / create_locations.exs
Last active March 31, 2016 22:16
Representing complex associations in Ecto
defmodule TaskRunner.Repo.Migrations.CreateLocations do
use Ecto.Migration
def change do
create table(:locations) do
add :type, :string
end
end
end
@davejlong
davejlong / new.sh
Last active February 5, 2016 17:30
I just shortened 53 lines of code to 1
DAY=$(date --date="-1 day" +%d)

Keybase proof

I hereby claim:

  • I am davejlong on github.
  • I am davejlong (https://keybase.io/davejlong) on keybase.
  • I have a public key ASC_AnHvZ6nBfTn67CtZNNGjfVkL08V_Z2Jm0LZvbhU4hAo

To claim this, I am signing this object:

@davejlong
davejlong / conference.rb
Last active October 4, 2015 10:35
Representing relationships in Lotus::Model
class Conference
include Lotus::Entity
attributes :title, :call_code, :technician_id
# Are the following 2 methods correct for representing the relationship to Technician
def technician
@technician ||= TechnicianRepository.find @technician_id
end