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
| CREATE OR REPLACE FUNCTION transliterate(my_text VARCHAR) RETURNS varchar AS $$ | |
| DECLARE | |
| text_out VARCHAR DEFAULT ''; | |
| BEGIN | |
| text_out := my_text; | |
| text_out := translate(text_out, 'áàâäåáăąãāçċćčĉéèėëêēĕîïìíīñôöøõōùúüûūýÿỳ', 'aaaaaaaaaaccccceeeeeeeiiiiinooooouuuuuyyy'); | |
| text_out := translate(text_out, 'ÁÀÂÄÅÁĂĄÃĀÇĊĆČĈÉÈĖËÊĒĔÎÏÌÍĪÑÔÖØÕŌÙÚÜÛŪÝŸỲ', 'AAAAAAAAAACCCCCEEEEEEEIIIIINOOOOOUUUUUYYY'); | |
| text_out := replace(text_out, 'æ', 'ae'); | |
| text_out := replace(text_out, 'Œ', 'OE'); | |
| text_out := replace(text_out, 'Æ', 'AE'); |
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
| CREATE OR REPLACE FUNCTION slugify(title VARCHAR) RETURNS varchar AS $$ | |
| SELECT trim(both '-' from regexp_replace(lower(transliterate(title)), '[^a-z0-9]+', '-', 'g')); | |
| $$ LANGUAGE sql IMMUTABLE; |
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
| // | |
| // Regular Expression for URL validation | |
| // | |
| // Author: Diego Perini | |
| // Created: 2010/12/05 | |
| // Updated: 2018/09/12 | |
| // License: MIT | |
| // | |
| // Copyright (c) 2010-2018 Diego Perini (http://www.iport.it) | |
| // |
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
| # Analyze text: "the <b>quick</b> bröwn <img src="fox"/> "jumped"" | |
| curl -XPUT 'http://127.0.0.1:9200/foo/' -d ' | |
| { | |
| "index" : { | |
| "analysis" : { | |
| "analyzer" : { | |
| "test_1" : { | |
| "char_filter" : [ | |
| "html_strip" |
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
| location = /favicon.ico { | |
| log_not_found off; | |
| access_log off; | |
| } | |
| location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { | |
| expires max; | |
| log_not_found off; | |
| } |
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
| declare -A FIPS | |
| declare -A STNAME | |
| FIPS[AK]=02; STNAME[AK]=Alaska | |
| FIPS[AL]=01; STNAME[AL]=Alabama | |
| FIPS[AR]=05; STNAME[AR]=Arkansas | |
| FIPS[AS]=60; STNAME[AS]=American Samoa | |
| FIPS[AZ]=04; STNAME[AZ]=Arizona | |
| FIPS[CA]=06; STNAME[CA]=California | |
| FIPS[CO]=08; STNAME[CO]=Colorado | |
| FIPS[CT]=09; STNAME[CT]=Connecticut |
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
| server { | |
| listen 80 default; | |
| server_name 192.168.0.34 localhost; | |
| server_tokens off; | |
| root /home/nginx/$host/web; | |
| index app.php index.php index.html; | |
| access_log /home/nginx/$host/app/logs/access.log; | |
| error_log /var/log/nginx/error.log; | |
| try_files $uri $uri/ @rewrite; |
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
| //////////////////////push_notifications.js/////////////////////// | |
| var apns = function(){ | |
| var pref = require('preferences').preferences; | |
| Titanium.Network.registerForPushNotifications({ | |
| types: [ | |
| Titanium.Network.NOTIFICATION_TYPE_BADGE, | |
| Titanium.Network.NOTIFICATION_TYPE_ALERT | |
| ], | |
| success: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
| # 0 is too far from ` ;) | |
| set -g base-index 1 | |
| # Automatically set window title | |
| set-window-option -g automatic-rename on | |
| set-option -g set-titles on | |
| #set -g default-terminal screen-256color | |
| set -g status-keys vi | |
| set -g history-limit 10000 |
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
| # Index | |
| --------------------------------------------------------------------- | |
| curl -XPUT http://localhost:9200/pictures/ -d ' | |
| { | |
| "settings": { | |
| "analysis": { | |
| "analyzer": { | |
| "index_analyzer": { | |
| "tokenizer": "standard", |
OlderNewer