Thursday, 23 August 2018

Python - Creating a Command Line Argument (argparse)

For those who often use the Terminal on Linux or cmd on Windows, they will often come into contact with the Command Line for example $ cd -h $ sudo apt-get -h $ dpkg --help $ arp -a With python we can create programs to run on the terminal. Example : import argparse #module def server_start (server, port):     print "Starting% s ... OK"% server     print "% s port:% s"% [...]

Install Slim Framework and Write Your First "Hello World"

Do you want to create a simple website but do you want to start from scratch or a complex framework? You need to try Slim Framework Installing Slim Framework would be much easier if we're using Composer. Create a folder (your project folder) in your Web server (htdocs for apache users). for example, we create "slim". create a new file "composer.json" inside slim and type this: {     [...]

Separating Routes In Node.js Express 4

If you prefer using the Query builder in Laravel instead of Eloquent, I'm on your side: D because I also use the query Builder for most Query activities in my Laravel Application. Well, usually the Coding default from birth might be: D, when the Insert, Update, Delete query might be something like this public function doUpdate ($ data) {     $ data = array (     [...]

Tips Error Handling Sederhana Pada Query Builder Laravel

If you prefer using the Query builder in Laravel instead of Eloquent, I'm on your side: D because I also use the query Builder for most Query activities in my Laravel Application. Well, usually the Coding default from birth might be: D, when the Insert, Update, Delete query might be something like this public function doUpdate ($ data) {     $ data = array (      'name' [...]

Example of Simple 'Advance Where' Query Builder in Laravel

Laravel tips this time I will give a simple code example for Searching the database using Query Builder in laravel. For example, we want to Search in a table, say, the 'article' table. there may have been a code like this before //MyModel.php public static function getSearch ($ search = null) {          // is_publish: 0 = pending, 1 = published     $ result = [...]

Learn Basic OOP in Python

Completing the Basic Python Series before, this time we will learn OOP in Python. Same As with OOP in other programming languages, OOP is of course we will discuss Class Object Constructor Method etc. Writing (syntax) class ClassName:              # ....         # .... or Employee class (object): In python we can make a Class Description / [...]

Tips Login dengan Username atau Email di Laravel

Not infrequently we include Username and Email in the registration form like this Email: Username: Password: .... then after the user has successfully registered, we usually ask to log in by including the username and password. But not infrequently can include either a Username or Email along with a password like this: Your Email or Username .. password ... Sign in So the user [...]

Codeigniter Web Optimization Tips [part 3]: Lazy Loading Images

Continuing the series Previously, this time a short tutorial we will discuss optimization techniques Codeigniter-based Website with Lazy Loading Images. Images or images are mandatory elements on every website, but can also be a boomerang for our website because it greatly affects the website's performance in terms of Time Response even from the Search Engine's "glasses". Previous Series Tutorial: [...]

Codeigniter: Write / Export to Excel with Spout Library

Previously we discussed how to read a large Excel file with Spout. Now it's time to make how to write or Export from PHP to Excel. Read: Codeigniter: Read Excel (Large) Files with Spout Here are the steps 1. Prepare your Codeigniter project folder 2. Download the Library Spout here 3. Copy Paste the Spout Library folder to application / third_party The Spout structure folder will be like [...]

Getting to know Polymorphism and its practice in PHP

Polymorphism is a concept in OOP where Classes are have different functionality from each other but at the same time apply the same Interface. For those of you who learn OOP in PHP it might be a little confused ... but we will give an example and an easy analogy so you understand. For example, we have an Android, iPhone, Blackberry ... they each have unique and different ways of working but they [...]