This file contains hidden or 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
$routeProvider.when("/resource/:slug", { | |
controller: "ResourceController", | |
resolve: { | |
check: ["$route", "$http", "$location", function($route, $http, $location){ | |
return $http.get("/views/" + $route.current.params.slug + ".html").success(function(res){ | |
return true; | |
}).error(function(res){ | |
return $location.path("/"); | |
}); | |
}] |
This file contains hidden or 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
/* Previous Considerations | |
* ------------------------------- */ | |
//a. It is necessary nodejs must be installed on pc/linux or mac. | |
//b. This server runs on 127.0.0.1:8081. You can access : | |
// - by console with '$ node main.js' | |
// - by browser by goint to http://127.0.0.1:8081/ | |
/* The very basic server | |
* -------------------------------*/ | |
// 1. Import required modules |
This file contains hidden or 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 | |
// Usage: | |
// 1. Open console | |
// 2. Go to desired folder and run the script by: | |
// $ php friendly-filename.php | |
// Optional: You can pass the desired folder by argument: | |
// $ php friendly-filename.php /desired/folder/I/want/to/make/it/friendly | |
This file contains hidden or 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
-- From http://scottbarnham.com/blog/2010/12/20/make-a-slug-in-postgresql-translating-diacritics/ | |
CREATE OR REPLACE FUNCTION getslug(texte varchar) RETURNS VARCHAR AS | |
$$ | |
DECLARE | |
result varchar; | |
BEGIN | |
-- Add formtat to special case | |
result := replace(texte , 'æ', 'ae'); | |
result := replace(result , 'œ', 'oe'); |
NewerOlder