Skip to content

Instantly share code, notes, and snippets.

View uaibo's full-sized avatar
🎯
Building systems

Altin uaibo

🎯
Building systems
  • Angel1 Albania
  • Tirana, Albania
View GitHub Profile
@uaibo
uaibo / app-password-bitbucket
Last active August 8, 2022 13:21
Add acces for yourself to bitbucket repo.
1) Generate your app password & grant access to Repositories
https://bitbucket.org/account/settings/app-passwords/
2) sudo nano .git/config
3) Add the following content
[remote "origin"]
url = https://{YOUR_BITBUCKET_USERNAME}:{APP_PASSWORD_YOU_HAVE_GENERATED}@bitbucket.org/{COMPANY_NAME}/{REPO_NAME}.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
@uaibo
uaibo / AppServiceProvider.php
Created February 2, 2021 21:12 — forked from simonhamp/AppServiceProvider.php
A pageable Collection implementation for Laravel
<?php
namespace App\Providers;
use Illuminate\Support\Collection;
use Illuminate\Pagination\LengthAwarePaginator;
class AppServiceProvider extends ServiceProvider
{
public function boot()
$total_free_reads = 3;
$cookie_name = 'article_reads';
function check_update_cookie() {
global $cookie_name;
if( is_single() ){
$expiry = strtotime('+1 month');
if( ! isset($_COOKIE[$cookie_name]) ){
UPDATE wp_users SET user_email = 'info@example.com' WHERE ID = 1;
UPDATE wp_options SET option_value = 'info@example.com' WHERE option_name = 'admin_email';
UPDATE wp_options SET option_value = 'info@example.com' WHERE option_name = 'new_admin_email';
@uaibo
uaibo / wp-config-sample.php
Last active June 23, 2020 14:26
wp-config sample for easy access of the site from localhost as well as 192.168...
<?php
//production by default
$ENV_KEY = 'prod';
$localDir = '';
//host vars
if ( defined('WP_CLI') ) {
$_SERVER['HTTP_HOST'] = 'localhost';
}
$hostName = $_SERVER['HTTP_HOST'];
DELETE a,c
FROM wp_posts a
LEFT JOIN wp_postmeta c ON ( a.ID = c.post_id )
WHERE a.post_type = 'post'
AND DATEDIFF(NOW(), a.post_date) > 300
Delete posts from x category
------------
DELETE a,b,c,d