Skip to content

Instantly share code, notes, and snippets.

View borantula's full-sized avatar

Bora Yalcin borantula

View GitHub Profile
@borantula
borantula / eksisozlukfix
Created February 28, 2016 09:45
Quick css fix for new unreadable design on eksisozluk
body {
background-color: #ddd;
}
#entry-list>li {
position: relative;
padding: 30px 20px;
background:#f3f3f3;
margin:10px 0;
font-size:18px;
border:1px solid #ccc;
@borantula
borantula / processwire-3-namespace-migrator.php
Last active April 25, 2016 07:38
Processwire 3 Namespace Migrator
<?php
/**
* This script attempts to add namespace Processwire to every .php and .module file in the given directory.
* It worked fine for my project but I cannot guarantee for you, so PLEASE take a backup or two before you
* attempt to try it.
*
* To use it put this in your root folder and navigate with your browser to the file like
* example.com/processwire-3-namespace-migrator.php
* Also you should disable the compiler by setting $config->templateCompile=false; in your /site/config.php.
*
@borantula
borantula / gist:1b00003cf3b37a42c549b347950e6c81
Created November 2, 2016 08:31
find all php shorttags reges
<\?(?!(php|=|xml))(\s|\t|\n)
@borantula
borantula / cakephp-features.php
Created January 14, 2017 21:24
CakePHP Features Example
<?php
/**
* Components are tightly connected (or appears so) to the controllers
* and as the application grows bigger, some of the work is done other places
* like event listener classes, mailers, shell commands, custom project classes etc.
* When that happens this can lead to code duplication from your components to those places.
*
* On a CakePHP project we are working on we starting using a structure called Features (idea taken
* from a Laravel community), where we have a "Feature Runner" trait, and a feature class structure which
* only includes a constructor and handle public methods and run as in example. By adding use FeatureRunner to any class
@borantula
borantula / cakephp-i18n-migration.php
Created February 13, 2017 10:47
CakePHP I18N Table Migration
<?php
use Migrations\AbstractMigration;
class ArticlesI18n extends AbstractMigration
{
/**
* Change Method.
*
* More information on this method is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-change-method
@borantula
borantula / importfromgzip.sh
Created November 27, 2017 10:47
Import gzip from console
#I keep forgetting this!
zcat myfile.sql.gz | mysql -u root -ppassword mydbname
@borantula
borantula / gist:f87f6a6c96318a5544e29ebd4f27b7ff
Created December 4, 2017 21:47
Renewing letsencrypt without certbot
service nginx stop;sudo -H /opt/letsencrypt/letsencrypt-auto renew;service nginx start
//https://www.facebook.com/ads/preferences/?entry_product=ad_settings_screen
//Put this in console and watch :)
clear();
document.querySelector('#u_0_t ._2qo2 ._2qo6').click();
setTimeout(()=>{
var seeMoreInterval = setInterval(()=>{
if(document.querySelector('._45yr')) {
document.querySelector('._45yr').click()
} else {
@borantula
borantula / gist:fd3497a6e7092bdef0f594cd8445aa23
Created July 4, 2018 07:54
Run command pm2 from other user as root
sudo runuser -l root -c 'pm2 restart myapp'
@borantula
borantula / upgradenode.bash
Created July 5, 2018 14:16
How to upgrade Node
sudo npm cache clean -f
sudo npm install -g n
sudo n stable