Skip to content

Instantly share code, notes, and snippets.

Alexander lxcodes

Block or report user

Report or block lxcodes

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View haproxy_maintenance.conf
#
# Proof of concept for a HAProxy maintenance mode
#
#
# Control the maintenance page during runtime using the stats socket:
#
# To put the whole site in maintenance mode (for all IPs):
# > add acl #0 0.0.0.0/0
#
# To exclude your own ip, so you are able to test things out:
@lxcodes
lxcodes / FormResponseController.ex
Last active Jun 30, 2016
Issues getting data assigned in changeset
View FormResponseController.ex
defmodule FhForm.API.HTML.FormResponseController do
use FhForm.Web, :controller
alias FhForm.Form
alias FhForm.FormResponse
def create(conn, params) do
IO.inspect params
form = Repo.get_by(Form, url_iden: params["url_identifier"])
changeset =
@lxcodes
lxcodes / gist:915baaf2f31355d3a218
Last active Sep 10, 2015 — forked from saetia/gist:1623487
Clean Install – OS X 10.11 El Capitan Developer Preview 2
View gist:915baaf2f31355d3a218

OS X Preferences


most of these require logout/restart to take effect

# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Set a shorter Delay until key repeat
@lxcodes
lxcodes / gist:ff35696b5ac535853e07
Created Jun 23, 2015
Long Ember Build With Time and DEBUG
View gist:ff35696b5ac535853e07
~/c/e/self-perform-calculator git:master ❯❯❯ time DEBUG=* ember build --environment=production ⏎ ✭ ✱
ember-cli:project getProjectRoot /Users/alexa/code/ember/self-perform-calculator -> /Users/alexa/code/ember/self-perform-calculator +0ms
ember-cli:cli/index leek: { trackingCode: 'UA-49225444-1', globalName: 'ember-cli', name: '58bd0263-4e76-485a-8dd0-8d61d1365f91', version: '0.2.7', silent: undefined } +64ms
leek initialize { trackingCode: 'UA-49225444-1', name: '58bd0263-4e76-485a-8dd0-8d61d1365f91', globalName: 'ember-cli', clientId: 'ember-clifaecb02f92a2a7635137fa9289aa028e', version: '0.2.7', silent: undefined } +0ms
ember-cli:cli testing false +5ms
ember-cli:project closestSync /Users/alexa/code/ember/self-perform-calculator -> /Users/alexa/code/ember/self-perform-calculator +1ms
ember-cli:project init root: /Users/alexa/code/ember/self-perform-calculator +0ms
ember-cli:project bowerrc path: /Users/alexa/code/ember/self-perform-calculator/.bowerrc +0ms
ember-cli:projec
View gist:754dd854c3882fd783d0
Catch
Entries: 12
additional
Struct
Detail
string
ErrorCode
string 0
Extended_Info
string
@lxcodes
lxcodes / CA Province - Territory List
Last active Aug 29, 2015 — forked from tvpmb/US State List
State Lists In JSON
View CA Province - Territory List
[
{ value: "CA-AB", label: "Alberta" },
{ value: "CA-BC", label: "British Columbia" },
{ value: "CA-MB", label: "Manitoba" },
{ value: "CA-NB", label: "New Brunswick" },
{ value: "CA-NL", label: "Newfoundland and Labrador" },
{ value: "CA-NS", label: "Nova Scotia" },
{ value: "CA-ON", label: "Ontario" },
{ value: "CA-PE", label: "Prince Edward Island" },
{ value: "CA-QC", label: "Quebec" },
View slack_nagios.sh
#!/bin/bash
# This script is used by Icinga to post alerts into a Slack channel
# using the Incoming WebHooks integration. Create the channel, botname
# and integration first and then add this notification script in your
# Icinga configuration.
#
# All variables that start with NAGIOS_ are provided by Icinga as
# environment variables when an notification is generated.
# A list of the env variables is available here:
@lxcodes
lxcodes / gist:76f8d0ba3b2cb1c983c7
Last active Aug 29, 2015
BoundOneWay Computed Property
View gist:76f8d0ba3b2cb1c983c7

Saved from https://github.com/emberjs/ember.js/issues/5462

The Ghost folks have a great implementation:

/**
 * Defines a property similarly to `Ember.computed.oneway`,
 * save that while a `oneway` loses its binding upon being set,
 * the `BoundOneWay` will continue to listen for upstream changes.
 *
 * This is an ideal tool for working with values inside of {{input}}
View ember-select.js
var get = Ember.get, set = Ember.set, computed = Ember.computed, defineProperty = Ember.defineProperty, observer = Ember.observer;
Ember.Select.reopen({
optionDisabledPath: null
});
Ember.SelectOption.reopen({
attributeBindings: ['disabled'],
init: function() {
View lord.js
(function(jQuery) {
// All new jQuery goes here
})(jQuery.noConflict(true));
You can’t perform that action at this time.