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'); |
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
/* 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
$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
var {graphql, buildSchema} = require('graphql'); | |
var schema = buildSchema (` | |
type Query{ | |
hello : String | |
} | |
`); | |
var root = { | |
hello: () => { | |
return 'Hello World.'; |
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
var input = document.querySelector('input'); | |
var observable = Rx.Observable.fromEvent(input,'input'); | |
observable | |
.map(e => e.target.value) | |
.filter((v)=> v.length > 0) | |
.debounceTime(500) | |
.distinctUntilChanged() | |
.subscribe({ | |
next: function(e){ |
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
var input = document.querySelector('input'); | |
var observable = Rx.Observable.fromEvent(input,'input'); | |
observable | |
.pluck('target','value') // nested attributes from event | |
.filter((v)=> v.length > 0) | |
.debounceTime(500) | |
.distinctUntilChanged() | |
.subscribe({ | |
next: function(e){ |
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
networkInterface.use([{ | |
applyMiddleware(req, next) { | |
let authToken = localStorage.getItem("authToken"); | |
if (authToken) { | |
req.options.headers = Object.assign({},req.options.headers, { | |
authorization: `Bearer ${authToken}` | |
}); | |
} | |
next(); | |
} |
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
1. Open Terminal, and then | |
iwconfig | |
and note down the wl* number. | |
2. Download new driver. Download rock.new_btcoex from GIT and unzip it to the desktop for example. | |
3. Again in Terminal type and run: | |
cd Desktop/rtlwifi_new-rock.new_btcoex | |
make | |
sudo make install type your ubuntu password. | |
sudo modprobe -rv rtl8723be | |
sudo modprobe -v rtl8723be ant_sel=2 |
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
## | |
# You should look at the following URL's in order to grasp a solid understanding | |
# of Nginx configuration files in order to fully unleash the power of Nginx. | |
# https://www.nginx.com/resources/wiki/start/ | |
# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/ | |
# https://wiki.debian.org/Nginx/DirectoryStructure | |
# | |
# In most cases, administrators will remove this file from sites-enabled/ and | |
# leave it as reference inside of sites-available where it will continue to be | |
# updated by the nginx packaging team. |
OlderNewer