Tutorial by Examples: current

Mage::app()->getStore(); Returns an instance of Mage_Core_Model_Store
It is possible to await multiple calls concurrently by first invoking the awaitable tasks and then awaiting them. public async Task RunConcurrentTasks() { var firstTask = DoSomethingAsync(); var secondTask = DoSomethingElseAsync(); await firstTask; await secondTask; } Alt...
function isDaylightSavings(d:Date):Boolean { var months:uint = 12; var offset:uint = d.timezoneOffset; var offsetCheck:Number; while (months--) { offsetCheck = (new Date(d.getFullYear(), months, 1)).timezoneOffset; if (offsetCheck != offset) ret...
Represents a thread-safe collection of key/value pairs that can be accessed by multiple threads concurrently. Creating an instance Creating an instance works pretty much the same way as with Dictionary<TKey, TValue>, e.g.: var dict = new ConcurrentDictionary<int, string>(); Ad...
Concurrent collections are a generalization of thread-safe collections, that allow for a broader usage in a concurrent environment. While thread-safe collections have safe element addition or removal from multiple threads, they do not necessarily have safe iteration in the same context (one may not...
sp_who2 This procedure can be used to find information on current SQL server sessions. Since it is a procedure, it's often helpful to store the results into a temporary table or table variable so one can order, filter, and transform the results as needed. The below can be used for a queryable v...
return http://www.example.com/skin/frontend/{interface}/{theme}/images/my-image.jpg
Mage::getSingleton('admin/session')->getUser();
Mage::helper('customer')->getCustomer(); or Mage::getSingleton('customer/session')->getCustomer();
git diff HEAD^ HEAD This will show the changes between the previous commit and the current commit.
SP.SOD.executeOrDelayUntilScriptLoaded(showUserInfo,"sp.js"); function showUserInfo(){ var clientContext = new SP.ClientContext(); var user = clientContext.get_web().get_currentUser(); clientContext.load(user); clientContext.executeQueryAsync(function(){ ...
pip assists in creating requirements.txt files by providing the freeze option. pip freeze --local > requirements.txt The --local parameter will only output a list of packages and versions that are installed locally to a virtualenv. Global packages will not be listed.
To generate a list (tree view) of currently installed packages, use npm list ls, la and ll are aliases of list command. la and ll commands shows extended information like description and repository. Options The response format can be changed by passing options. npm list --json json - Sh...
Getting all the information of current user in wordpress using the predefined function wp_get_current_user(); <?php $current_user = wp_get_current_user(); echo "Username :".$current_user->user_login; echo "Username :".$current_user-&g...
Consider the utility class pattern: a class with only static methods and no fields. It's recommended to prevent instantiation of such classes by adding a private a constructor. This live template example makes it easy to add a private constructor to an existing class, using the name of the enclos...
All published ISO standards are available for sale from the ISO store ( http://www.iso.org ). The working drafts of the C++ standards are publicly available for free though. The different versions of the standard: Upcoming (Sometimes referred as C++20 or C++2a): Current working draft (HTML-vers...
package main import ( "fmt" "io/ioutil" ) func main() { files, err := ioutil.ReadDir(".") if err != nil { panic(err) } fmt.Println("Folders in the current directory:") for _, fileInfo := range files { ...
Swift webview.reload() Objective-C [webview reload];
A branch is just a pointer to a commit, so you can freely move it around. To make it so that the branch is referring to the commit aabbcc, issue the command git reset --hard aabbcc Please note that this will overwrite your branch's current commit, and as so, its entire history. You might loose s...
GCD provides mechanism for performing a loop, whereby the loops happen concurrently with respect to each other. This is very useful when performing a series of computationally expensive calculations. Consider this loop: for index in 0 ..< iterations { // Do something computationally expens...

Page 2 of 7