Skip to content

Instantly share code, notes, and snippets.

@danmcclain
danmcclain / sample.star
Created January 20, 2022 02:01
Passing values to starlark via pixlet
load("render.star", "render")
def main(args):
return render.Root(
child = render.Text(args["name"]),
)
[core]
excludesfile = /Users/dan/configs/.gitignore
autocrlf = input
quotepath = false
pager = less -r
[alias]
co = checkout
br = branch
ci = commit
st = status
@danmcclain
danmcclain / client.ex
Last active November 15, 2016 19:51
JSON API client API
defmodule SomeAPI.Client do
use JSONAPIClient
host "https://example.com"
namespace "api/v1"
register_type :users, SomeAPI.User
register_type :orgs, SomeAPI.Org
end
;; -*- 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
@danmcclain
danmcclain / application.controller.js
Last active February 19, 2016 22:09
Ember-deferred-content
import Ember from 'ember';
const { RSVP } = Ember;
export default Ember.Controller.extend({
promise: null,
resolve: null,
reject: null,
init() {
@danmcclain
danmcclain / gist:9c3b8c9bc6eb580dcb95
Created January 13, 2016 21:27
Supporting JSON API Links at root level for pagination
commit 6dc7a15bd3b680fe7ded81ea77531ee297a5a732
Author: Dan McClain <git@danmcclain.net>
Date: Wed Jan 13 16:25:27 2016 -0500
WIP Spike out override of AdapterPopulatedRecordArray to support links
diff --git a/app/ext/adapter-populated-record-array.js b/app/ext/adapter-populated-record-array.js
new file mode 100644
index 0000000..77ea745
--- /dev/null
import Ember from 'ember';
Ember.LinkComponent.reopen({
attributeBindings: ['data-autoid']
});
Ember.TextField.reopen({
attributeBindings: ['data-autoid']
});
import Ember from 'ember';
export default Ember.Component.extend({
attributeBindings: ['type', 'value', 'checked', 'style', 'disabled'],
tagName: 'input',
classNames: ['checkbox__input'],
type: 'checkbox',
click: function(){
this.sendAction('action');
}
defmodule Logobase.Deserializer do
def init(options) do
options
end
def call(conn, _opts) do
case Phoenix.Controller.get_format(conn) do
"json-api" ->
_deserialize(conn)
_ ->
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle'
});