Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am barmatz on github.
  • I am barmatz (https://keybase.io/barmatz) on keybase.
  • I have a public key whose fingerprint is 1A2B 7EE8 CA84 EBF8 129D 0261 9661 EA48 3EFB 099D

To claim this, I am signing this object:

@barmatz
barmatz / error-parser.js
Last active September 22, 2015 10:05
JavaScript error parser
function errorParser(err) {
if (err) {
if (typeof err === 'function') {
err = err();
}
if (typeof err === 'object') {
if ('responseText' in err) {
err = err.responseText;
@barmatz
barmatz / request.js
Created September 21, 2015 18:52
JavaScript XHR promise wrapper for Ember
function request(method, url, data) {
var defferred, xhr;
if (!data) {
data = {};
}
defferred = new Ember.RSVP.Promise(function (resolve, reject) {
xhr = Ember.$.ajax({
method: method,
@barmatz
barmatz / x-modal.js
Created September 30, 2015 21:20
Ember Bootstrap Modal
(function () {
'use strict';
App.XModalComponent = Ember.Component.extend({
title: null,
backdrop: true,
keyboard: true,
propertiesDidChange: Ember.observer('backdrop', 'keyboard', function () {
this.refresh();
}),
@barmatz
barmatz / ec2-install-lamp-part-1
Created November 11, 2016 12:39
The following procedures help you install the Apache web server with PHP and MySQL support on your Amazon Linux instance
#!/bin/bash
# update yum
sudo yum update -y
# install Apache web server, MySQL, and PHP
sudo yum install -y httpd24 php56 mysql55-server php56-mysqlnd
# start the Apache web server
sudo service httpd start
#!/bin/bash
# verify membership in the www group
groups
# change the group overship
sudo chown -R root:www /var/www
# change the directory premissions
sudo chmod 2775 /var/www