This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Database Driver Extension | |
* | |
* DEPENDENCIES: | |
* CodeIgniter 2.x.x (with ActiveRecord turned on) | |
* is_associative() function -- place in autoloaded helper file. It should load early enough before any queries. | |
* | |
* This Extension allows you to insert/update, batch insert/batch update, and delete from any | |
* table within your database simply with an easy interface |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function splitWords($paragraph, $numberOfWords) { | |
$returnArray = array(); | |
$splittedString = explode(" ", $paragraph); | |
$counter = 0; | |
$counter2 = 0; | |
for($x = 0; $x < count($splittedString); $x++) { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// includes bindings for fetching/fetched | |
var PaginatedCollection = Backbone.Collection.extend({ | |
initialize: function() { | |
_.bindAll(this, 'parse', 'url', 'pageInfo', 'nextPage', 'previousPage'); | |
typeof(options) != 'undefined' || (options = {}); | |
this.page = 1; | |
typeof(this.perPage) != 'undefined' || (this.perPage = 10); | |
}, | |
fetch: function(options) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<table id="cart"> | |
<thead> | |
<tr> | |
<th></th> | |
<th>Price/Bottle</th> | |
<th>Quantity</th> | |
<th>Total</th> | |
</tr> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The procedure for setting up automatic private/public key login on our servers is as follows: | |
- On your own machine, go to $HOME/.ssh and type: ssh-keygen -t dsa | |
- When prompted for it, leave the default location for the file and let the passphrase empty | |
- Copy the content of the "id_dsa.pub" file that just got created into the $HOME/.ssh/authorized_keys and authorized_keys2 on our machine. | |
- Set the following permissions: | |
chmod 644 $HOME/.ssh/authorized_keys* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
server_name [host]; | |
root /var/www/[document_root]; ## <-- Your only path reference. | |
# Enable compression, this will help if you have for instance advagg module | |
# by serving Gzip versions of the files. | |
gzip_static on; | |
location = /favicon.ico { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
server_name [host]; | |
root /var/www/[document_root]; ## <-- Your only path reference. | |
# Enable compression, this will help if you have for instance advagg module | |
# by serving Gzip versions of the files. | |
gzip_static on; | |
location = /favicon.ico { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
There are a lot of complaints going around about Laravel these days, but a lot | |
of the important ones seem to be missing from the spotlight. | |
Bugfixes, issues and pull requests being left open for months with no | |
clarification of intent: | |
- https://github.com/laravel/framework/pull/1799 | |
- https://github.com/laravel/framework/issues/1963 | |
- https://github.com/laravel/framework/issues/2089 | |
- https://github.com/laravel/framework/issues/2234 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function slugify($str) { | |
$search = array('Ș', 'Ț', 'ş', 'ţ', 'Ş', 'Ţ', 'ș', 'ț', 'î', 'â', 'ă', 'Î', 'Â', 'Ă', 'ë', 'Ë'); | |
$replace = array('s', 't', 's', 't', 's', 't', 's', 't', 'i', 'a', 'a', 'i', 'a', 'a', 'e', 'E'); | |
$str = str_ireplace($search, $replace, strtolower(trim($str))); | |
$str = preg_replace('/[^\w\d\-\ ]/', '', $str); | |
$str = str_replace(' ', '-', $str); | |
return preg_replace('/\-{2,}', '-', $str); | |
} |
OlderNewer