Tutorial by Examples: st

Returns the first element that matches the selector starting at the element and traversing up the DOM tree. HTML <div id="abc" class="row"> <div id="xyz" class="row"> </div> <p id="origin"> Hello &...
For the character entity character(len=5), parameter :: greeting = "Hello" a substring may be referenced with the syntax greeting(2:4) ! "ell" To access a single letter it isn't sufficient to write greeting(1) ! This isn't the letter "H" but greeting(1:...
requests.get() creates a GET request: response = requests.get('https://example.com/') Pass in query parameters as a dictionary to the params argument: response = requests.get('https://example.com/', params={"a": 1, "b": 2}) For GET requests that might require basic authen...
Filters allows you to apply a function to a variable. This function may take 0 or 1 argument. Here is the syntax: {{ variable|filter_name }} {{ variable|filter_name:argument }} Filters can be chained so this is perfectly valid: {{ variable|filter_name:argument|another_filter }} If transla...
Sometimes what you want to do is just too complex for a filter or a simple_tag. Fow this you will need to create a compilation function and a renderer. In this example we will create a template tag verbose_name with the following syntax: ExampleDescription{% verbose_name obj %}Verbose name of a mo...
Asynchronously var fs = require('fs'); fs.stat('path/to/file', function(err) { if (!err) { console.log('file or directory exists'); } else if (err.code === 'ENOENT') { console.log('file or directory does not exist'); } }); Synchronously here, we must wr...
Content has been moved back to good 'ol JSP wiki page
You've made a stash and wish to checkout only some of the files in that stash. git checkout stash@{0} -- myfile.txt
TCO is only available in strict mode As always check browser and Javascript implementations for support of any language features, and as with any javascript feature or syntax, it may change in the future. It provides a way to optimise recursive and deeply nested function calls by eliminating the n...
Log into your AWS Console and click on Lambda under the Services tab. Under Functions you'll be able to Create a Lambda function using the same-labeled button. You'll be shown a screen where you can select a blueprint. These are simply starting points to existing Lambda functions fo...
/// <summary> /// Gets displayName from DataAnnotations attribute /// </summary> /// <typeparam name="TModel"></typeparam> /// <typeparam name="TProperty"></typeparam> /// <param name="htmlHelper"></param> /// <pa...
/// <summary> /// Creates simple button /// </summary> /// <param name="poHelper"></param> /// <param name="psValue"></param> /// <returns></returns> public static MvcHtmlString SubmitButton(this HtmlHelper poHelper, string ps...
Using a CDN: <!DOCTYPE html> <head> <script src="https://cdn.jsdelivr.net/rxjs/4.1.0/rx.min.js"></script> </head> <body> <script> // `Rx` is available var one$ = Rx.Observable.of(1); var onesub = one$.subscribe(function (...
Mage::log('My log entry', null, 'mylogfile.log'); This wil log to /var/log/mylogfile.log
Detailed instructions on getting facebook-graph-api set up or installed.
PHP provides an alternative syntax for some control structures: if, while, for, foreach, and switch. When compared to the normal syntax, the difference is, that the opening brace is replaced by a colon (:) and the closing brace is replaced by endif;, endwhile;, endfor;, endforeach;, or endswitch;, ...
Objective-C //set off-image mySwitch.offImage = [UIImage imageNamed:@"off_image"]; [mySwitch setOffImage:[UIImage imageNamed:@"off_image"]]; //set on-image mySwitch.onImage = [UIImage imageNamed:@"on_image"]; [mySwitch setOnImage:[UIImage imageNamed:@"on_im...
SP.SOD.executeOrDelayUntilScriptLoaded( function(){ deleteItem(1); }, "sp.js"); function deleteItem(id){ var clientContext = new SP.ClientContext(); var list = clientContext.get_web().get_lists().getByTitle("List Title"); var item = list.getItemById(id); it...
SP.SOD.executeOrDelayUntilScriptLoaded(showDialog,"sp.js"); function showDialog(){ SP.UI.ModalDialog.showModalDialog( { url: "/org/it/web/wik/Lists/ExampleCode/DispForm.aspx?ID=6" } ); }
SP.SOD.executeOrDelayUntilScriptLoaded(myFunction,"sp.js"); function myFunction(){ var clientContext = new SP.ClientContext(); var list = clientContext.get_web().get_lists().getByTitle("List Title"); var item = list.getItemById(1); // get item with ID == 1 ...

Page 81 of 369