Tutorial by Examples

Within the Schema Builder, use the Schema facade with any connection. Run the connection() method to specify which connection to use: Schema::connection('mysql2')->create('some_table', function($table) { $table->increments('id'): });
Similar to Schema Builder, define a connection on the Query Builder: $users = DB::connection('mysql2')->select(...);
There are multiple ways to define which connection to use in the Eloquent models. One way is to set the $connection variable in the model: <?php class SomeModel extends Eloquent { protected $connection = 'mysql2'; } The connection can also be defined at runtime via the setConnect...
When applied on a map, returns a new map with new or updated key val pairs. It can be used to add new information in existing map. (def userData {:name "Bob" :userID 2 :country "US"}) (assoc userData :age 27) ;; { :name "Bob" :userID 2 :country "US&qu...
function exampleCloseIncident(id, status){ var parameters = {}; var incidentresolution = {}; incidentresolution["[email protected]"] = "/incidents(" + id + ")"; incidentresolution["@odata.type"] = "Microsoft.Dynamics.CRM.incidentre...
This function tells whether a given time lies within a a given time interval. (require '[clj-time.core :as t]) (def date1 (t/date-time 2016 11 5)) (def date2 (t/date-time 2016 12 5)) (def test-date1 (t/date-time 2016 12 20)) (def test-date2 (t/date-time 2016 11 15)) (t/within? (t/interva...
Python Most commonly used scenario: open page in new window switch to it do something close it switch back to parent window # Open "Google" page in parent window driver.get("https://google.com") driver.title # 'Google' # Get parent window parent_window = driver...
Data can be extracted from a blastdb using blastdbcmd which should be included in a blast installation. You can specify from the options below as part of -outfmt what metadata to include and in what order. From the man page: -outfmt <String> Output format, where the available format sp...
Detailed instructions on getting tortoisesvn set up or installed.
Above example helps us how to turn on SSH on Pi. This example is the prerequisite of above example. For Linux OS: Open the terminal and write down this ssh pi@your local IP address. Then you will need to provide the password. Note: Here pi: your raspberry pi username and your local IP address: th...
public class ExpandBarExample { private final Display display; private final Shell shell; public ExpandBarExample() { display = new Display(); shell = new Shell(display); shell.setLayout(new FillLayout()); // Create the ExpandBar on the Shell ...
public class ExpandBarDynamicContentExample { private final Display display; private final Shell shell; public ExpandBarDynamicContentExample() { display = new Display(); shell = new Shell(display); shell.setLayout(new FillLayout()); // Create...
UPDATE wp_options SET option_value = replace(option_value, 'OLD_SITE, 'NEW_SITE') WHERE option_name = 'home' OR option_name = 'siteurl'; UPDATE wp_posts SET guid = replace(guid, 'OLD_SITE','NEW_SITE'); UPDATE wp_posts SET post_content = replace(post_content, 'OLD_SITE', 'NEW_SITE');
/** * Add meta box to post types. * * @since 1.0.0 */ function myplugin_add_meta_box() { // Set up the default post types/ $types = array( 'post', ); // Optional filter for adding the meta box to more types. Uncomment to use. // $types = apply_filters( 'mypl...
Imagine many users all running a web application that is trying to increment a counter in the database. Each user must read the current count, add one and write out the updated value. To make sure no one reads the counter while someone else is is adding one we use a transaction: ref.transaction(fun...
Publishers and subscribers don't need to know each other. They simply communicate with the help of message queues. (function () { var data; setTimeout(function () { data = 10; $(document).trigger("myCustomEvent"); }, 2000); ...
// Remove the auto-paragraph and auto-line-break from the content remove_filter( 'the_content', 'wpautop' ); // Remove the auto-paragraph and auto-line-break from the excerpt remove_filter( 'the_excerpt', 'wpautop' );
/** * Remove the automatic line breaks from content and excerpts. * * @since 1.0.0 */ function remove_content_auto_line_breaks() { // Remove the auto-paragraph and auto-line-break from the content remove_filter( 'the_content', 'wpautop' ); // Remove the auto-paragraph and a...
Every Heroku app runs in at least two environments: on Heroku (we’ll call that production) and on your local machine (development). If more than one person is working on the app, then you’ve got multiple development environments - one per machine, usually. Usually, each developer will also have a te...
Let's start using ExtJS to build a simple web application. We will create a simple web application which will have only one physical page (aspx/html). At a minimum, every ExtJS application will contain one HTML and one JavaScript file—usually index.html and app.js. The file index.html or your defa...

Page 1206 of 1336