Skip to content

Instantly share code, notes, and snippets.

View bm2ilabs's full-sized avatar
🎯
Focusing

Boukraa Mohamed bm2ilabs

🎯
Focusing
View GitHub Profile
@bm2ilabs
bm2ilabs / after.sh
Last active August 29, 2015 14:18 — forked from cluppi/after.sh
#!/bin/sh
# Config for SSL.
echo "--- Making SSL Directory ---"
mkdir /etc/nginx/ssl
echo "--- Copying $i SSL crt and key ---"
openssl req -nodes -new -x509 -keyout /etc/nginx/ssl/server.key -out /etc/nginx/ssl/server.crt -subj "/C=US/ST=NY/L=NYC/O=Dis/CN=www.example.com"
echo "--- Turning SSL on in nginx.conf. ---"
<?php
class EloquenFooRepository
{
/**
* The base eloquent model
* @var Eloquent
*/
protected $model;
@bm2ilabs
bm2ilabs / backbone.js
Created March 21, 2013 10:10 — forked from JeffreyWay/backbone.js
backbone.js
// In Backbone, when passing a collection around, do you prefer to inject the
// collection into the view, or store it on a global namespace?
// Injection
var SomeCollectionView = Backbone.View.extend({
initialize: function() {
// this.collection
}
});
new SomeCollectionView({ collection: App.myCollection });
@bm2ilabs
bm2ilabs / assert.php
Created March 21, 2013 10:08 — forked from joemay/assert.php
assert.php
<?php
/**
* Simple wrapper around the
* PHPUnit assertion library.
*
* Assert::equals(21, $age);
* Assert::greaterThan(20, $age);
* Assert::has('Joe', ['John', 'Joe']);
*/
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>=5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}