Skip to content

Instantly share code, notes, and snippets.

View msalahz's full-sized avatar
🎯
Focusing

Mohammed Zaghloul msalahz

🎯
Focusing
View GitHub Profile
@msalahz
msalahz / Brocfile.js
Last active August 29, 2015 14:16 — forked from lukes/Brocfile.js
var EmberApp = require('ember-cli/lib/broccoli/ember-app');
var app = new EmberApp({
// Custom settings for broccoli-assets-rev
// See http://www.ember-cli.com/#asset-compilation
fingerprint: {
enabled: true
}
});
//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Updated: 2010/12/05
// License: MIT
//
// Copyright (c) 2010-2013 Diego Perini (http://www.iport.it)
//
// Permission is hereby granted, free of charge, to any person
@msalahz
msalahz / iterm2-solarized.md
Created March 21, 2017 14:07 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k

@msalahz
msalahz / ember-addon-essentials.md
Created April 17, 2017 18:27 — forked from BrianSipple/ember-addon-essentials.md
Ember Addon Essentials -- A checklist of some of the finer details to keep in mind when developing Ember addons

Ember Addon Essentials

This document is meant to be a brief "checklist" of things to setup for your Ember addon when beginning development in order to have the best possible architecture and workflow out of the gate. For more comprehensive material, the following are bookshelf-caliber:

Filling out package.json

@msalahz
msalahz / Local SSL websites on macOS Sierra.md
Last active August 2, 2017 10:55 — forked from jonathantneal/README.md
Local SSL websites on macOS Sierra

Local SSL websites on macOS Sierra

These instructions will guide you through the process of setting up local, trusted websites on your own computer.

These instructions are intended to be used on macOS Sierra, but they have been known to work in El Capitan, Yosemite, Mavericks, and Mountain Lion.

NOTE: You may substitute the edit command for nano, vim, or whatever the editor of your choice is. Personally, I forward the edit command to Sublime Text:

alias edit="/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl"
@msalahz
msalahz / controllers.application.js
Last active October 26, 2017 13:43 — forked from poteto/controllers.application.js
ember-changeset-validations demo
import Ember from 'ember';
import AdultValidations from '../validations/adult';
import ChildValidations from '../validations/child';
import { reservedEmails } from '../validators/uniqueness';
import { schema } from '../models/user';
const { get } = Ember;
const { keys } = Object;
export default Ember.Controller.extend({
@msalahz
msalahz / .gitlab-ci.yml
Created October 26, 2017 08:40 — forked from mupkoo/.gitlab-ci.yml
Using Ember-CLI with Chrome on GitLab CI
image: node:7.10
cache:
paths:
- node_modules/
- bower_components/
before_script:
# Install Chrome
- wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
@msalahz
msalahz / postgres_table_row_count.sql
Created December 24, 2017 21:53
Row counts for all tables in a postgres db.
SELECT schemaname,relname,n_live_tup
FROM pg_stat_user_tables
ORDER BY n_live_tup DESC;
@msalahz
msalahz / squirt.js
Created January 14, 2018 00:32 — forked from joelpt/squirt.js
Manually calculate the square root of a number with Javascript
// The Babylonian Method
// http://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method
// @param n - the number to compute the square root of
// @param g - the best guess so far (can omit from initial call)
function squirt(n, g) {
if (!g) {
// Take an initial guess at the square root
g = n / 2.0;
}
var d = n / g; // Divide our guess into the number
var arr = ["a", "b", "c"];
var obj = {};
/* Method no: 1 */
arr.forEach(function(item, index) {
obj[index] = item;
});