- get something from a remote site (
loadPage()
) - find specific element (
findElement()
) - grab and parse contents as JSON (
extractJson()
)
Easy way: grab page and return result
# connect to mysql using .env file | |
env-mysql () | |
{ | |
yellow=$(tput -Txterm setaf 3) | |
lt_blue=$(tput -Txterm setaf 6) | |
reset=$(tput -Txterm sgr0) | |
if [ -f .env ]; then | |
. .env | |
fi |
Ten skrypt w prosty sposób obchodzi maskowanie hasła dla centrum24.pl (BZWBK).
<?php | |
$id = Input::get('SSID'); | |
Session::save(); | |
Session::setId($id); | |
unset($_SESSION); | |
Session::start(); |
" Simple way to turn off Gdiff splitscreen | |
" works only when diff buffer is focused | |
if !exists(":Gdiffoff") | |
command Gdiffoff diffoff | q | Gedit | |
endif |
On some special situations (probably bad server config) Gitlab instead of queuing email throws 500 error.
To fix it You can force Gitlab to send emails immediately.
Just run this script inside gitlab installation folder (normally it's /home/gitlab/gitlab):
grep -r "Notify.delay" app/* | cut -d":" -f1 | xargs sed -i.bak -e"s/Notify\.delay\.\(.*\)/Notify.\1.deliver/"
RewriteEngine On | |
RewriteBase / | |
RewriteCond %{DOCUMENT_ROOT}/static/%{REQUEST_URI} -f | |
RewriteRule ^(.*)$ /static/$1 [L,QSA] | |
RewriteCond %{DOCUMENT_ROOT}/static/%{REQUEST_URI}/index.html -f | |
RewriteRule ^(.*)$ /static/$1/index.html [L,QSA] | |
RewriteRule ^index\.php$ - [L] |
{"www.youtube.com":{"_enabled":true,"_rules":{"div.comments-section":{"display":"none"}}},"www.trojmiasto.pl":{"_enabled":true,"_rules":{"div.opinions-wrap.opinions-tree":{"display":"none"}}},"wyborcza.pl":{"_enabled":true,"_rules":{"#article_toolbar":{"display":"none"}}},"*":{"_enabled":true,"_rules":{}},"gazeta.pl":{"_enabled":true,"_rules":{"#article_toolbar":{"display":"none"}}}} |
#! /bin/bash | |
### BEGIN INIT INFO | |
# Provides: gitlab | |
# Required-Start: $local_fs $remote_fs $network $syslog redis-server | |
# Required-Stop: $local_fs $remote_fs $network $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: GitLab git repository management | |
# Description: GitLab git repository management | |
### END INIT INFO |
<?php | |
$verbs = 'GET|POST|PUT|DELETE|PATCH'; | |
$routeToRegex = function ($string) use ($verbs) { | |
$string = preg_replace("/^({$verbs})/", '', $string); | |
$string = preg_replace('/\{\w+\}/', '\w+', $string); | |
$string = preg_replace('/\{(\w+):(.+?)\}/', '\2', $string); | |
return '#^'.$string.'$#'; | |
}; |