Skip to content

Instantly share code, notes, and snippets.

View alexparker's full-sized avatar
♻️
Who → Why → How → What

Alex Parker alexparker

♻️
Who → Why → How → What
View GitHub Profile
@alexparker
alexparker / modal.styl
Created November 27, 2017 18:37
Easy flexible modals (remodal)
html.modal-active
overflow: hidden
touch-action: none
.modal-overlay
background: alpha(black, 80%)
bottom: -5000px
left: -5000px
position: fixed
right: -5000px
import Ember from 'ember';
import data from '../data';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
users: data,
});
@alexparker
alexparker / up-and-running-with-edeliver-on-do.md
Created March 26, 2017 23:22 — forked from mattweldon/up-and-running-with-edeliver-on-do.md
Getting Elixir / Phoenix running on Digital Ocean with edeliver

Build Server

  • Go to Digital Ocean
  • Create new droplet
  • London
  • Ubuntu
  • No apps
  • Add SSH keys
model.eachAttribute(function(name, meta) {
var methodName = name + "Valid";
var errorsKey = "errors." + name;
var method = function() {
var isValid = Ember.isEmpty(this.get(errorsKey));
if (isValid) {
return 'valid';
} else {
return 'input--error';
@alexparker
alexparker / keybase.md
Created May 18, 2015 22:09
keybase.md

Keybase proof

I hereby claim:

  • I am alexparker on github.
  • I am alexparker (https://keybase.io/alexparker) on keybase.
  • I have a public key whose fingerprint is 4319 7F29 E21A D3C0 9AB3 CB30 94D2 987A A6ED E7EC

To claim this, I am signing this object:

/* jshint expr:true */
import { expect, should } from 'chai';
import {
describeModel,
it
} from 'ember-mocha';
describeModel(
'order',
'OrderModel',
@alexparker
alexparker / *bigcartel.slack.com*
Created September 11, 2014 18:14
UserScript for toggling slack sidebar
var sideBar = $('#col_channels_bg').is(':visible');
$(window).on('keypress', function(e) {
// uses cmd+b
if (e.metaKey && e.charCode == 98) {
var display = sideBar ? 'none' : 'initial';
var left = sideBar ? 0 : '';
$('#col_channels_bg, #col_channels').css('display', display);
$('#messages_container').css('margin-left', left);
$('#footer').css('left', left);
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>PAGE_TITLE</title> <!-- this will be replaced automatically -->
<meta http-equiv="X-UA-Compatible" content="IE=edge;chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
@alexparker
alexparker / debug.sh
Created April 7, 2014 06:12
Failing install of atom git-plus package
> runas@0.5.4 install /private/var/folders/lx/m3dypp4n7hgcf1dssbb31d_00000gp/T/apm-install-dir-11437-47180-2gg269/node_modules/git-plus/node_modules/pathwatcher/node_modules/runas
> node-gyp rebuild
npm http GET https://registry.npmjs.org/pathwatcher
npm http 304 https://registry.npmjs.org/pathwatcher
npm http GET https://registry.npmjs.org/bindings
npm http GET https://registry.npmjs.org/nan/0.8.0
npm http GET https://registry.npmjs.org/q
npm http GET https://registry.npmjs.org/emissary
@alexparker
alexparker / preorders_controller.rb
Created April 5, 2014 16:16
Strange `undefined method model_url` error. Am I missing something with decent exposure? Is the namespace on the controller causing an issue?
class Api::PreordersController < ApplicationController
respond_to :json
expose :preorder, attributes: :preorder_params
def create
preorder.save
respond_with preorder # does not work
# respond_with preorder, location: api_preorder_url(preorder) # works
end