Skip to content

Instantly share code, notes, and snippets.

View zaherg's full-sized avatar
🎯
Focusing

Zaher Ghaibeh zaherg

🎯
Focusing
View GitHub Profile

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying

function XCallbackURL(_url) {
this.url = _url;
this.parsedURI = parseUri(_url);
}
XCallbackURL.prototype.isCallbackURL = function() {
return this.parsedURI.host.toLowerCase() == 'x-callback-url';
};
XCallbackURL.prototype.action = function() {
return this.parsedURI.file;
};
@zaherg
zaherg / index.html
Created August 13, 2013 11:47 — forked from crofty/index.html
<!DOCTYPE html>
<html>
<head>
<title>Leaflet</title>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.css" />
<script src="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.js"></script>
<script src="http://maps.google.com/maps/api/js?v=3.2&sensor=false"></script>
<script src="http://matchingnotes.com/javascripts/leaflet-google.js"></script>
</head>
<body>
<?php
// app/start/global.php
/*
|--------------------------------------------------------------------------
| Application Error Logger
|--------------------------------------------------------------------------
|
| Here we will configure the error logger setup for the application which
http://benpickles.github.io/peity/
http://www.humblesoftware.com/finance/index
https://github.com/HumbleSoftware/envisionjs
http://humblesoftware.com/flotr2/
http://dygraphs.com/
http://tenxer.github.io/xcharts/examples/
http://square.github.io/cubism/
http://www.justgage.com/
@zaherg
zaherg / app.js
Created June 14, 2013 12:31 — forked from viezel/app.js
// This is an example of use.
// Here we use the new Bearer Token thats make it possible to get tweets without user login
// More info on Bearer here: https://dev.twitter.com/docs/auth/application-only-auth
// Full Codebird API is here: https://github.com/mynetx/codebird-js
var Codebird = require("codebird");
var cb = new Codebird();
cb.setConsumerKey('CONSUMER_KEY', 'CONSUMER_SECRET_KEY');
var bearerToken = Ti.App.Properties.getString('TwitterBearerToken', null);
# Initial setup
git clone -o framework -b develop https://github.com/laravel/laravel.git project-name
cd project-name
git checkout --orphan master
git commit -m "Initial commit"
# Pulling changes
git fetch framework
git merge --squash -m "Upgrade Laravel" framework/develop
# Fix merge conflicts if any and commit

Awesome PHP

A list of amazingly awesome PHP libraries, resources and shiny things.

Composer

// Copyright Stephen Feather and other contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//