Basic text classification with elasticsearch need language analyzer Source: https://www.elastic.co/blog/text-classification-made-easy-with-elasticsearch
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
function erroPS($eV) { | |
let $err = ''; | |
switch($eV) | |
{ | |
case "5003": $err = "Falha de comunicação com a instituição financeira"; break; | |
case "10000": $err = "Marca de cartão de crédito inválida"; break; | |
case "10001": $err = "Número do cartão de crédito com comprimento inválido"; break; | |
case "10002": $err = "Formato da data inválida"; break; | |
case "10003": $err = "Campo de segurança CVV inválido"; break; | |
case "10004": $err = "Código de verificação CVV é obrigatório"; break; |
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
#!/bin/sh | |
# Your heartbeat URL here (must be hosted on this server) | |
URL_TO_CHECK="http://ngb1.ahvideoscdn.net" | |
# Your temp file to monitor downtime | |
DOWN_FILE="/root/site_down"; | |
# How long will you tolerate downtime in minutes | |
DOWN_TIME="+0"; | |
HTTP_STATUS=`curl -s -o /dev/null -w "%{http_code}" "$URL_TO_CHECK"`; |
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 removeDomainsFromString($string){ | |
return trim( preg_replace('/[a-zA-Z]*[:\/\/]*[A-Za-z0-9\-_]+\.+[A-Za-z0-9\.\/%&=\?\-_]+/i','',preg_replace('/[^@\s]*@[^@\s]*\.[^@\s]*/', '',$string))); | |
} |
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
window.mobileAndTabletcheck = function() { | |
var check = false; | |
(function(a){if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01 |
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 | |
namespace x\minify\_ { // start namespace | |
$n = __NAMESPACE__; | |
\define($n . "\\token_boolean", '\b(?:true|false)\b'); | |
\define($n . "\\token_number", '-?(?:(?:\d+)?\.)?\d+'); | |
\define($n . "\\token_string", '(?:"(?:[^"\\\]|\\\.)*"|\'(?:[^\'\\\]|\\\.)*\')'); |
Merge files
Cd folder with all files
cat *.csv >combined.csv
Shuffle lines
perl -MList::Util=shuffle -e 'print shuffle();' < myfile > target_file
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
! function(n) { | |
var o = null, | |
e = function() { | |
var t, e; | |
try { | |
t = window.top.document.getElementsByTagName("head")[0] | |
} catch (e) { | |
t = document.getElementsByTagName("head")[0] | |
} | |
t && ((e = t.getElementsByTagName("title")[0]) && (o = "textContent" in e ? e.textContent : "innerText" in e ? e.innerText : "")) |
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
zip ./public_html/fb.zip ./public_html -r -x '*.html' -x '*.cache' -x '*.jpg' -x '*uploads/*' -x '*.log' -x '*.xml' -x '*.zip' -x '*.gz' |
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 | |
/** | |
* Create a web friendly URL slug from a string. | |
* | |
* Although supported, transliteration is discouraged because | |
* 1) most web browsers support UTF-8 characters in URLs | |
* 2) transliteration causes a loss of information | |
* | |
* @author Sean Murphy <sean@iamseanmurphy.com> | |
* @copyright Copyright 2012 Sean Murphy. All rights reserved. |