Skip to content

Instantly share code, notes, and snippets.

Avatar
♻️
Who → Why → How → What

Alex Parker alexparker

♻️
Who → Why → How → What
View GitHub Profile
@alexparker
alexparker / modal.styl
Created Nov 27, 2017
Easy flexible modals (remodal)
View modal.styl
html.modal-active
overflow: hidden
touch-action: none
.modal-overlay
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
alexparker / up-and-running-with-edeliver-on-do.md
Created Mar 26, 2017 — forked from mattweldon/up-and-running-with-edeliver-on-do.md
Getting Elixir / Phoenix running on Digital Ocean with edeliver
View up-and-running-with-edeliver-on-do.md

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';
View 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:

View order-test.js
/* jshint expr:true */
import { expect, should } from 'chai';
import {
describeModel,
it
} from 'ember-mocha';
describeModel(
'order',
'OrderModel',
@alexparker
alexparker / *bigcartel.slack.com*
Created Sep 11, 2014
UserScript for toggling slack sidebar
View *bigcartel.slack.com*
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">
<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 Apr 7, 2014
Failing install of atom git-plus package
View debug.sh
> 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 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
preorder.save
respond_with preorder # does not work
# respond_with preorder, location: api_preorder_url(preorder) # works
end