Tutorial by Examples: ee

String#to_time Converts a string to a Time value. The form parameter can be either :utc or :local, defaults to :local. "13-12-2012".to_time # => 2012-12-13 00:00:00 +0100 "06:12".to_time # => 2012-12-13 06:12:00 +0100 "2012-12-13 06...
String#exclude? The inverse of String#include? "hello".exclude? "lo" # => false "hello".exclude? "ol" # => true "hello".exclude? ?h # => false
String#squish Returns a version of the given string without leading or trailing whitespace, and combines all consecutive whitespace in the interior to single spaces. Destructive version squish! operates directly on the string instance. Handles both ASCII and Unicode whitespace. %{ Multi-line ...
String#pluralize Returns of plural form of the string. Optionally takes a count parameter and returns singular form if count == 1. Also accepts a locale parameter for language-specific pluralization. 'post'.pluralize # => "posts" 'octopus'.pluralize # => &quot...
The entries() method returns a new Array Iterator object that contains the key/value pairs for each index in the array. 6 var letters = ['a','b','c']; for(const[index,element] of letters.entries()){ console.log(index,element); } result 0 "a" 1 "b" 2 "c"...
Open Android Monitor Tab Click on Screen Capture Button
Open Android Device Monitor ( ie C:<ANDROID_SDK_LOCATION>\tools\monitor.bat) Select your device Click on Screen Capture Button
Example below saves a screenshot on Devices's Internal Storage. adb shell screencap /sdcard/screen.png
If you use Linux (or Windows with Cygwin), you can run: adb shell screencap -p | sed 's/\r$//' > screenshot.png
To enable - type: :set number or :set nu. To disable - type: :set nonumber or :set nonu. To enable enumerating relative to the cursor location - type: :set relativenumber. To disable enumerating relative to the cursor location - type: :set norelativenumber. Note: To change whether the curren...
Facade is structural design pattern. It hides the complexities of large system and provides a simple interface to client. Client uses only Facade and it's not worried about inter dependencies of sub-systems. Definition from Gang of Four book: Provide a unified interface to a set of interfaces i...
Character escaping is what allows certain characters (reserved by the regex engine for manipulating searches) to be literally searched for and found in the input string. Escaping depends on context, therefore this example does not cover string or delimiter escaping. Backslashes Saying that backsla...
Use the link attribute in the document's head: <head> <link rel="stylesheet" type="text/css" href="stylesheet.css"> </head> You can also use stylesheets provided from websites via a content delivery network, or CDN for short. (for example, Bo...
You can also include CSS elements internally by using the <style> tag: <head> <style type="text/css"> body { background-color: gray; } </style> </head> Multiple internal stylesheets can be included in a program as...
It's possible to load multiple stylesheets: <head> <link rel="stylesheet" type="text/css" href="general.css"> <link rel="stylesheet" type="text/css" href="specific.css"> </head> Note that later files a...
SELECT DATE('2003-12-31 01:02:03'); The output will be: 2003-12-31
Use git revert to revert existing commits, especially when those commits have been pushed to a remote repository. It records some new commits to reverse the effect of some earlier commits, which you can push safely without rewriting history. Don't use git push --force unless you wish to bring down ...
Extensions add new functionality to an existing class, structure, enumeration, or protocol type. This includes the ability to extend types for which you do not have access to the original source code. Extensions in Swift can: Add computed properties and computed type properties Define instance ...
PhpStorm can be very slow in large files as its performing so many inspections. One quick and easy way to speed up PhpStorm is to render using OpenGL. Previously in a 5000 line file it would give the 'eye' symbol in the top right for a long time before changing to a tick (or red/yellow box). After O...
If you want to lock the screen orientation change of any screen (activity) of your android application you just need to set the android:screenOrientation property of an <activity> within the AndroidManifest.xml: <activity android:name="com.techblogon.screenorientationexample.Main...

Page 22 of 54