Tutorial by Examples

add_action( 'wp_enqueue_scripts', 'enqueue_my_styles_and_scripts' ); /** * Enqueue scripts (or styles) conditionally. * * Load scripts (or stylesheets) specifically for IE. IE10 and above does * not support conditional comments in standards mode. * * @link https://gist.github.com/wpsc...
Mysql has its EVENT functionality for avoiding complicated cron interactions when much of what you are scheduling is SQL related, and less file related. See the Manual page here. Think of Events as Stored Procedures that are scheduled to run on recurring intervals. To save time in debugging Event-r...
An array column is supported by PostgreSQL. Rails will automatically convert a PostgreSQL array to a Ruby array, and vice-versa. Create a table with an array column: create_table :products do |t| t.string :name t.text :colors, array: true, default: [] end Add an array column to an existi...
Make sure your tomcat configurations file, server.xml has this line: <Connector port="8443" protocol="org.apache.coyote.http11.Http11Protocol" maxHttpHeaderSize="8192" SSLEnabled="true" maxThreads="150" minSpareThrea...
PHP 5.5 introduces Generators and the yield keyword, which allows us to write asynchronous code that looks more like synchronous code. The yield expression is responsible for giving control back to the calling code and providing a point of resumption at that place. One can send a value along the yi...
Icicle uses Awaitables and Generators to create Coroutines. require __DIR__ . '/vendor/autoload.php'; use Icicle\Awaitable; use Icicle\Coroutine\Coroutine; use Icicle\Loop; $generator = function (float $time) { try { // Sets $start to the value returned by microtime() after ap...
A common refrain in R goes along these lines: You should not have a bunch of related tables with names like DT1, DT2, ..., DT11. Iteratively reading and assigning to objects by name is messy. The solution is a list of tables of data! Such a list looks like set.seed(1) DT_list = lapply(setNam...
Unzipping a zip archive is done with unzip function from the utils package (which is included in base R). unzip(zipfile = "bar.zip", exdir = "./foo") This will extract all files in "bar.zip" to the "foo" directory, which will be created if necessary. Tilde...
Listing files in a zip archive is done with unzip function from the utils package (which is included in base R). unzip(zipfile = "bar.zip", list = TRUE) This will list all files in "bar.zip" and extract none. Tilde expansion is done automatically from your working directory. ...
Listing files in a tar archive is done with untar function from the utils package (which is included in base R). untar(zipfile = "bar.tar", list = TRUE) This will list all files in "bar.tar" and extract none. Tilde expansion is done automatically from your working directory. ...
Extracting files from a tar archive is done with untar function from the utils package (which is included in base R). untar(tarfile = "bar.tar", exdir = "./foo") This will extract all files in "bar.tar" to the "foo" directory, which will be created if nece...
This attribute applies a version to the assembly. [assembly: AssemblyVersion("1.0.*")] The * character is used to auto-increment a portion of the version automatically every time you compile (often used for the "build" number)
Using .NET's rich reflection APIs, you can gain access to an assembly's metadata. For example, you can get this assembly's title attribute with the following code using System.Linq; using System.Reflection; ... Assembly assembly = typeof(this).Assembly; var titleAttribute = assembly.GetCust...
Iterators produce enumerators. In C#, enumerators are produced by defining methods, properties or indexers that contain yield statements. Most methods will return control to their caller through normal return statements, which disposes all state local to that method. In contrast, methods that use y...
Codeigniter may be configured to run more than one project without duplicating CI core files. It's possible by splitting CI Application side. For example let's take project of website, which contains front-end and back-end Content Management System (CMS) applications. In this case CI folder struct...
When defining themes, one usually uses the theme provided by the system, and then changes modifies the look to fit his own application. For example, this is how the Theme.AppCompat theme is inherited: <style name="AppTheme" parent="Theme.AppCompat"> <item name=&quo...
Vlookup finds some value in the leftmost column of a range and returns a value some number of columns to the right and in the same row. Let's say you want to find the surname of Employee ID 2 from this table: =VLOOKUP(2,$A$2:$C$4,3,0) The value you're retrieving data for is 2 The table you...
https://github.com/jaymedavis/stripe.net is a great starting point. Assuming you are using MVC w/Razor you need to have a few things in your View page <script type="text/javascript" src="https://js.stripe.com/v2/"></script> This script calls upon the stripe.js t...
Your code in source control has version numbers either by default (SVN ids or Git SHA1 hashes) or explicitly (Git tags). Rather than manually updating versions in AssemblyInfo.cs you can use a build time process to write the version from your source control system into your AssemblyInfo.cs files and...
It's good practice to complete your AssemblyInfo's default fields. The information may be picked up by installers and will then appear when using Programs and Features (Windows 10) to uninstall or change a program. The minimum should be: AssemblyTitle - usually the namespace, i.e. MyCompany.MySo...

Page 583 of 1336