Skip to content

Instantly share code, notes, and snippets.

View yugaego's full-sized avatar
🌻
Let the flowers grow.

YE yugaego

🌻
Let the flowers grow.
View GitHub Profile
@yugaego
yugaego / style.css
Created April 27, 2016 10:38 — forked from salilpa/style.css
Bootstrap styling for jQuery UI autocomplete. CSS expanded version
.ui-autocomplete {
position: absolute;
top: 100%;
left: 0;
z-index: 1000;
float: left;
display: none;
min-width: 160px;
_width: 160px;
padding: 4px 0;
@yugaego
yugaego / js-browser.md
Created September 1, 2016 12:02
Javasciprt Identify Browser

http://stackoverflow.com/questions/5899783/detect-safari-using-jquery

    var is_chrome = navigator.userAgent.indexOf('Chrome') > -1;
    var is_explorer = navigator.userAgent.indexOf('MSIE') > -1;
    var is_firefox = navigator.userAgent.indexOf('Firefox') > -1;
    var is_safari = navigator.userAgent.indexOf("Safari") > -1;
    var is_opera = navigator.userAgent.toLowerCase().indexOf("op") > -1;
    if ((is_chrome)&&(is_safari)) {is_safari=false;}
 if ((is_chrome)&&(is_opera)) {is_chrome=false;}
@yugaego
yugaego / query.md
Created January 28, 2017 12:29
MySQL Slow Logs Query
SELECT query_time, rows_examined, sql_text, user_host 
FROM mysql.slow_log 
WHERE sql_text NOT LIKE "%INFORMATION_SCHEMA%" 
ORDER BY query_time DESC, rows_examined DESC 
LIMIT 0,25;
@yugaego
yugaego / opcache.ini
Last active May 11, 2017 14:15
PHP OPcache Config
; Enable Zend OPcache extension module
zend_extension=opcache.so
; Determines if Zend OPCache is enabled
opcache.enable=1
; Determines if Zend OPCache is enabled for the CLI version of PHP
;opcache.enable_cli=0
; The OPcache shared memory storage size.
@yugaego
yugaego / codeception.md
Created June 22, 2017 12:31
Codeception Browser Tabs Switching (Not Tested)
// @source http://phptest.club/t/browser-tab-open-new-swicht-to-last-1-2-3-4-5-close/866
/**
 * $I->newBrowserTab();
 */
public function newBrowserTab()
{
    $I = $this;
    $I->pressKey('body', array("ctrl", "t"));
}
@yugaego
yugaego / driveclient
Created July 23, 2017 12:39
Rackspace services logs rotation
# docs
https://support.rackspace.com/how-to/cloud-backup-agent-logging-basics/
# file path
/etc/driveclient/log4cxx.xml
# contents
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
<appender name="FILE" class="org.apache.log4j.RollingFileAppender">
<param name="File" value="/var/log/driveclient.log"/>
@yugaego
yugaego / readme.md
Last active September 13, 2017 14:23
Install and Enable Supervisor on Centos 7

Install

sudo yum install supervisor
sudo systemctl enable supervisord
sudo systemctl start supervisord
sudo systemctl status supervisord

Example program

/etc/supervisord.conf

@yugaego
yugaego / composer.php
Created November 9, 2017 13:09
Running composer from a browser
<?php
header("Content-type: text/html");
//
// Run composer with a PHP script in browser
//
// http://stackoverflow.com/questions/17219436/run-composer-with-a-php-script-in-browser
error_reporting(E_ALL);
ini_set('display_errors', 1);
@yugaego
yugaego / console-command.js
Created May 5, 2018 12:20
Output Infusionsoft Merchants Accounts ID using JavaScript
var merchants = 'Merchant Accounts:\n';
jQuery('#defaultMerchantAccount option').each(function(i, elem){
if (elem.value) {
merchants += '\t• ID ' + elem.value.split('|')[0] + '\t' + elem.text + '\n';
}
});
alert(merchants);