Skip to content

Chris' Laboratory

chrislee.kr – Personal blog as bookshelves

Menu
  • Home
  • Github
  • Contact Me
Menu

Category: Frameworks

PHP imap_open() error – INBOX: invalid remote specification (errflg=2)

Posted on 31/10/2016 by Chris Lee

INBOX: invalid remote specification (errflg=2)   Got following error when use imap_open() in PHP?   Notice: Unknown: Can’t open mailbox {imap.gmail.com:993/imap/ssl/novalidate-cert}INBOX: invalid remote specification (errflg=2) in Unknown on line 0   Check imap enabled SSL support like screenshot   If cannot see SSL Support configuration, then need re-compile imap.so with enabling SSL support.     PHP…

Continue reading

PTV Timetable API sample code for PHP

Posted on 11/10/201611/10/2016 by Chris Lee

API Page: https://www.ptv.vic.gov.au/about-ptv/ptv-data-and-reports/digital-products/ptv-timetable-api/ptv-timetable-api-reference/   1. Request API key by sending email How to register for a key and developer ID > Send an email to APIKeyRequest@ptv.vic.gov.au with the following information in the subject line of the email: • “PTV Timetable API – request for key” > Once we’ve got your email request, we’ll send you a…

Continue reading

Vagrant Scalable Web Application Architecture

Posted on 10/09/201610/09/2016 by Chris Lee

Deploying scalable web application using Vagrant, Consul, Consul Template, nginx and HAProxy Source Repo: https://github.com/chrisleekr/vagrant-scalable-web-application-architecture This is proof-of-concept project to spin up scalable web application architecture with Vagrant. The project involves: Vagrant for launching multiple VM instances and persistent storage Consul for health checking and service discovery Consul Template for automated load balancer management nginx for…

Continue reading

Vagrant MySQL Master-Slave Replication

Posted on 22/08/201629/08/2020 by Chris Lee

Vagrant MySQL Master-Slave Replication Source Repo: https://github.com/chrisleekr/vagrant-mysql-master-slave-replication Vagrantfile to spin up MySQL Master-Slave replication with persistent data storage Note: This project is created for just practice. Not suitable for production use. Prerequisites Vagrant 1.8.1+: http://www.vagrantup.com/ VirtualBox: https://www.virtualbox.org/ Usage $ git clone https://github.com/chrisleekr/vagrant-mysql-master-slave-replication.git $ cd vagrant-mysql-master-slave-replication $ vagrant up After vagrant machines are running, you can connect…

Continue reading

WebSocket Sample

Posted on 17/09/201510/09/2016 by Chris Lee

The sample process Send event to Web Socket for getting order id Web Socket connects MySQL orders table and get next order id Send event back to client with message and next order id Sample Environment Node.js Modules: mysql, socket.io PHP MySQL Filename: serverfile.js // Open port 3000 var io = require(‘socket.io’).listen(3000); // Load mysql…

Continue reading

Configure Aptana to support PHP 5.4

Posted on 20/04/201523/11/2015 by Chris Lee

I am using Aptana Studio 3 in Mac. When I try to set PHP 5.4 environment in project settings, it does not save the changes. And found this article – http://stackoverflow.com/questions/24633995/aptana-php-version-doesnt-stick-in-project-properties 1. Open project folder 2. Create folder .settings 3. Create file com.aptana.editor.php.prefs and Put below content into created file eclipse.preferences.version=1 phpVersion=php5.4 4. Close project and re-open

Continue reading

Sample XAMPP MySql my.ini Fast Performance

Posted on 23/09/201429/08/2020 by Chris Lee

Only use in local test MySQL. # Example MySQL config file for large systems. # # This is for a large system with memory = 512M where the system runs mainly # MySQL. # # MySQL programs look for option files in a set of # locations which depend on the deployment platform. # You…

Continue reading

SmartOptimizer with CS-Cart optimization

Posted on 16/09/201410/09/2016 by Chris Lee

Reference: http://forum.cs-cart.com/topic/29499-speed-up-and-optimise-cs-cart-version-3/ In store root .htaccess DirectoryIndex index.html index.php <IfModule mod_rewrite.c> RewriteEngine on # Pleas note that RewriteBase setting is obsolete use it only in case you experience some problems with SEO addon. # Some hostings require RewriteBase to be uncommented # Example: # Your store url is http://www.yourcompany.com/store/cart # So “RewriteBase” should be: #…

Continue reading

Javascript Skill Test

Posted on 28/06/201411/09/2016 by Chris Lee

Found this test from the internet (Download: JavaScript_Skill_Test-blank) Tried to solve without using Google. FAILED. With help from Google, solved questions. There was someone’s solution for exact same questions; I resisted a lot to not see his solution. Some questions are referred  to understand what question was.  If I get this test in the interview without…

Continue reading

Run Internet Explorer in Mac using VirtualBox

Posted on 28/06/201428/06/2014 by Chris Lee

  Reference: http://osxdaily.com/2011/09/04/internet-explorer-for-mac-ie7-ie8-ie-9-free/ curl -s https://raw.githubusercontent.com/xdissent/ievms/master/ievms.sh | bash Or just download https://raw.githubusercontent.com/xdissent/ievms/master/ievms.sh and execute downloaded shell program.

Continue reading

Set a variable in Django template

Posted on 08/06/201410/09/2016 by Chris Lee

Summary 1. Create “templatetags” folder at the same level as models.py, views.py. 2. Create “__init__.py” file in “templatetags” folder. The content will be empty. 3. Create “set_var.py” file in “templatetags” folder. And copy and paste below code from django import template register = template.Library() class SetVarNode(template.Node): def __init__(self, var_name, var_value): self.var_name = var_name self.var_value =…

Continue reading

money_format_alt

Posted on 04/06/201410/09/2016 by Chris Lee

Alternative code snippet for money_format function money_format_alt($amount, $decimal, $symbol = ‘$’, $symbol_right = ”, $symbol_thousands = ‘,’, $symbol_decimal = ‘.’) { if ($amount < 0) return ‘-‘.$symbol . (number_format(abs($amount), $decimal, $symbol_decimal, $symbol_thousands)) . $symbol_right; return $symbol.number_format($amount, $decimal, $symbol_decimal, $symbol_thousands).$symbol_right; }  

Continue reading

EnvironmentError: mysql_config not found

Posted on 09/05/201429/08/2020 by Chris Lee

I am using Mac OS X 10.9, MAMP 1.9 (MySQL 5.1.44), Python 2.7.5. Got this error when I change database configuration in settings.py. I felt this issue can make me painful, so I start logging what happened and how I fixed. Do not follow below steps. Just go straightly bottom of article and read last…

Continue reading

VPS – Apache & MySQL Performance Tuning

Posted on 13/03/201429/08/2020 by Chris Lee

Apache 1. Open/Create /var/www/vhosts/{hostname}/conf/vhosts.conf 2. Add oradjust below code KeepAlive On MaxKeepAliveRequests 29 KeepAliveTimeout 15 3. Copy to make backup of apache configuration # cp -p /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.YYYY-MM-DD.bak 4. Execute below shell script one by one # ramCount=`awk ‘match($0,/vmguar/) {print $4}’ /proc/user_beancounters` # ramBase=-16 && for ((;ramCount>1;ramBase++)); do ramCount=$((ramCount/2)); done # perl -0 -p -i…

Continue reading

.htaccess GZIP Compression & Enable Keep-alive

Posted on 07/03/201410/09/2016 by Chris Lee

To make faster webpage loading, use Gzip compress and Enable keep-alive in htaccess <ifModule mod_deflate.c> AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript </ifModule> <ifModule mod_headers.c> Header set Connection keep-alive </ifModule>   In Plesk Control Panel, follow below steps Access SSH as root user Go to /var/www/vhosts/{domain}/conf Create or Modify vhosts.conf Add following code…

Continue reading

Test website speed in various server location 웹사이트 속도 체크

Posted on 07/03/201429/08/2020 by Chris Lee

Test website speed in various server location 웹사이트 속도 체크 http://www.webpagetest.org/  

Continue reading

Detect when scroll is reached end of scroll

Posted on 18/02/201410/09/2016 by Chris Lee

Using jQuery, determine that user has been scrolled until the end of element. Reference: http://stackoverflow.com/questions/6271237/detecting-when-user-scrolls-to-bottom-of-div-with-jquery $(‘.scrollable’).bind(‘scroll’, function(){ if($(this).scrollTop() + $(this).innerHeight() >= $(this)[0].scrollHeight) { alert(‘end reached’); } });    

Continue reading

Codeigniter CRUD Model Code Generator

Posted on 13/02/201418/02/2014 by Chris Lee

    http://chrislee.kr/sources/generate_ci_model/      

Continue reading

DNS Prefetching to reduce DNS resolution time

Posted on 16/01/201410/09/2016 by Chris Lee

<!DOCTYPE HTML> <html> <head> <meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ /> <link rel=”dns-prefetch” href=”//www.robgravelle.com/”> …   “The recommended best practice is to have your prefetch requests queued to the client OS as early as possible. It is also preferred to have them received in the first packet of the HTML. Therefore, explicit prefetch links should be placed…

Continue reading

Make Retina display ready for input submit button with image

Posted on 28/08/201311/09/2016 by Chris Lee

When use input[type=image] for form submission, the image is stretched when use Retina Display mobile. Since you cannot change ‘src’ attribute using CSS, I had to find another way to accomplish this. Someone said to use ‘content’ in CSS can do, but I failed. And this method is not browser compatible. Anyway, you can make…

Continue reading

Media Query Reporter CSS Injection

Posted on 03/07/201310/09/2016 by Chris Lee

Ref: http://webdesigntutsplus.s3.amazonaws.com/tuts/221_responsive_widget/Media-Query-Files-DEMO/index.html <link rel=”stylesheet” type=”text/css” media=”screen” href=”http://webdesigntutsplus.s3.amazonaws.com/tuts/221_responsive_widget/Media-Query-Files-DEMO/styles-mediaquery-reporter.css” />   Code Only: /* ====================================== MediaQuery-Reporter Styles ========================================= */ body:after { content: “less than 320px”; font-size: 300%; font-weight: bold; position: fixed; bottom: 60px; width: 100%; text-align: center; background-color: hsla(1,60%,40%,0.7); color: #fff; } @media only screen and (min-width: 320px) { body:after { content: “320 to 480px”; background-color: hsla(90,60%,40%,0.7);…

Continue reading

WordPress JSON API – Support since(from) date/time

Posted on 29/06/201311/09/2016 by Chris Lee

WordPress JSON API (http://wordpress.org/plugins/json-api/) is a powerful plugin that allows RESTful API for WordPress. However, I needed specific post query such as “Get posts since 1999/01/01 11:00:00”, which JSON API did not support. After doing hours research to do so, I couldn’t find relavant answers. Since JSON API uses WP_Query in WordPress, I thought I…

Continue reading

Aptana Increase Memory Size & Excluding unnecessary files

Posted on 26/06/201326/06/2013 by Chris Lee

  Mac Application -> Aptana Studio 3 -> Click “AptanaStudio3.app” -> Right Click “Show Package Contents” -> Contents -> MacOS -> Open “AptanaStudio3.ini” with any text editor 1.  –launcher.XXMaxPermSize 512m 2.  -Xms512m 3.  -Xmx1024m -startup ../../../plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar –launcher.library ../../../plugins/org.eclipse.equinox.launcher.cocoa.macosx_1.1.101.v20120109-1504 –launcher.XXMaxPermSize 512m –launcher.defaultAction openFile -vmargs -Xms512m -Xmx1024m -Declipse.p2.unsignedPolicy=allow -Declipse.log.size.max=10000 -Declipse.log.backup.max=5 -Xdock:icon=../Resources/aptana.icns -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts   Windows Go to C:\Users\Chris\AppData\Local\Aptana Studio…

Continue reading

To re-size images with keeping aspect ratio and fitting to certain dimensions

Posted on 07/06/201310/09/2016 by Chris Lee

To re-size images with keeping aspect ratio and fitting to certain dimensions function _create_thumbnail($actual_filepath, $folder_path, $target_filename, $width, $height) { // $this->load->library(‘image_lib’); // $image_lib_config = array( // ‘image_library’ => ‘gd2’ // , ‘source_image’ => $actual_filepath // , ‘new_image’ => $folder_path.$target_filename // , ‘maintain_ratio’ => true // , ‘width’ => $width // , ‘height’ => $height //…

Continue reading

SQLite – could not prepare statement (1 too many SQL variables)

Posted on 02/05/2013 by Chris Lee

During development for SQLite, I have got this error could not prepare statement (1 too many SQL variables) Accroding to this article, this error is because of SQLite limitation, which cannot put variables more than 999 variables. After I reduce the amount of variables, it worked very well.    

Continue reading
  • Previous
  • 1
  • 2
  • 3
  • 4
  • Next

Categories

  • Databases (11)
    • MongoDB (4)
    • MS-SQL (1)
    • MySQL (6)
  • E-Commerce (8)
    • Magento (8)
  • Finance (2)
  • Frameworks (84)
    • Adobe Flex (1)
    • Angular (ngx) (3)
    • Codeigniter (6)
    • CSS (5)
    • Django (2)
    • Javascript (13)
    • Node.js (6)
    • PHP (17)
    • React Native (4)
    • React.js (1)
    • Sencha Touch (4)
    • Terraform (1)
    • Vue.js (1)
    • WordPress (4)
    • Yii2 (3)
  • General Documents (15)
  • Marketing (3)
  • Mobile Development (33)
    • Android (20)
    • iPhone (13)
  • Platforms (21)
    • Arduino (2)
    • Docker (5)
    • Google App Engine (5)
    • Raspberry Pi (5)
    • Samsung Smart TV (4)
  • Security (17)
  • Server (31)
    • Linux (13)
  • Tools (14)
    • SVN (7)
  • Uncategorized (3)

Search

Recent Posts

  • helm list error stream ID 3; INTERNAL_ERROR
  • Bootstrapping Kubernetes cluster with kubeadm
  • Taint all resources in the one module
  • Alpine – Plugin caching_sha2_password could not be loaded
  • npm link with peerDependencies

Recent Comments

  • Obayed on Binance Auto Trading Bot – Buy low/Sell high with stop loss limit/Trade multiple coins
  • Ari on How to install memcache.so/memcached.so for MAMP Pro (Mac)
  • Mida ali on Binance Auto Trading Bot – Buy low/Sell high with stop loss limit/Trade multiple coins
  • Chris Lee on How to install memcache.so/memcached.so for MAMP Pro (Mac)
  • Chris Lee on Setting Up A VPN Server On OSX 10.6

Tags

1 ajax amazon android android-addpart browser chrislee-kr codeigniter codeigniter-tcpdf com-apple-net-racoon CSS CSS history hack delpaigmail-com entity-addpart-double exception-printing-is-disabled-by-default-for-security-reasons ext-plugins-listpagingplugin ext-plugins-listpagingplugin-example f iphone javascript jquery-defaultchecked jquery-samsung-smart-tv listpagingplugin mac magento-exception-printing-is-disabled-by-default-for-security-reasons magento-sample-data-exception-printing-is-disabled-by-default-for-security-reasons nu-vot null-core-errors-confignotfound-config-mk9engine-ini php samsung-smart-tv-jquery samsung-smart-tv-sdk-ajax samsung-smart-tv-sdk-jquery samsung-tv-sdk samsung-tv-sdk-jquery samsung tv sencha-smart-tv sencha-touch-list-paging smart-tv-jquery sqlite subversion svn tcedook tcpdf-codeigniter uilinebreakmodecharacterwrap-is-deprecated unknown-column-link-area

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
© 2023 Chris' Laboratory | Powered by Minimalist Blog WordPress Theme
Chris' Laboratory
Proudly powered by WordPress Theme: Dark Minimalistblogger.
 

Loading Comments...