Skip to content

Instantly share code, notes, and snippets.

Who → Why → How → What

Alex Parker alexparker

Who → Why → How → What
View GitHub Profile
alexparker / modal.styl
Created Nov 27, 2017
Easy flexible modals (remodal)
View modal.styl
overflow: hidden
touch-action: none
background: alpha(black, 80%)
bottom: -5000px
left: -5000px
position: fixed
right: -5000px
View controllers.application.js
import Ember from 'ember';
import data from '../data';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
users: data,
alexparker /
Created Mar 26, 2017 — forked from mattweldon/
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
View order-detail.js
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';

Keybase proof

I hereby claim:

  • I am alexparker on github.
  • I am 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:

View order-test.js
/* jshint expr:true */
import { expect, should } from 'chai';
import {
} from 'ember-mocha';
alexparker / **
Created Sep 11, 2014
UserScript for toggling slack sidebar
View **
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);
View thing.html
<!doctype html>
<html lang="en">
<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 /
Created Apr 7, 2014
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
npm http 304
npm http GET
npm http GET
npm http GET
npm http GET
alexparker / preorders_controller.rb
Created Apr 5, 2014
Strange `undefined method model_url` error. Am I missing something with decent exposure? Is the namespace on the controller causing an issue?
View preorders_controller.rb
class Api::PreordersController < ApplicationController
respond_to :json
expose :preorder, attributes: :preorder_params
def create
respond_with preorder # does not work
# respond_with preorder, location: api_preorder_url(preorder) # works