Tutorial by Examples

Use the GitHub repository to get the entire code: https://github.com/firebase/functions-samples/blob/master/quickstarts/email-users Copy or clone the repository in your computer. Now go to your Firebase Console Create a Firebase Project using the Firebase Console. Enable the Google Provid...
$BucketName = 'trevorrekognition' $FileName = 'kitchen.jpg' New-S3Bucket -BucketName $BucketName Write-S3Object -BucketName $BucketName -File $FileName $REKResult = Find-REKLabel -Region us-east-1 -ImageBucket $BucketName -ImageName $FileName $REKResult.Labels After running the script ab...
$BucketName = 'trevorrekognition' ### Create a new AWS S3 Bucket New-S3Bucket -BucketName $BucketName ### Upload two different photos of myself to AWS S3 Bucket Write-S3Object -BucketName $BucketName -File myphoto1.jpg Write-S3Object -BucketName $BucketName -File myphoto2.jpg ### Perform...
This macro gives the output of a given line as the last argument of the next line function call. For e.g. (prn (str (+ 2 3))) is same as (->> 2 (+ 3) (str) (prn))
(defn x [a b] (* a b)) ;; public function => (x 3 2) ;; 6 => (x 0 9) ;; 0 (defn- y [a b] (+ a b)) ;; private function => (x (y 1 2) (y 2 3)) ;; 15
If you add this to your functions.php it removes the WordPress version number from the RSS feed and the header. function remove_wordpress_ver() { return ''; } add_filter('the_generator', 'remove_wordpress_ver', 999);
var Human = function() { this.canWalk = true; this.canSpeak = true; // }; Person.prototype.greet = function() { if (this.canSpeak) { // checks whether this prototype has instance of speak this.name = "Steve" console.log('Hi, I am ' + this.name); } else{ c...
HTML <div :class="classes"> <input v-model="compValue" type="text" class="form-control" @keydown.enter = 'enter' @keydown.down = 'down' @keydown.up = 'up' @input = "cha...
This macro gives the output of a given line as the first argument of the next line function call. For e.g. (rename-keys (assoc {:a 1} :b 1) {:b :new-b})) Can't understand anything, right? Lets try again, with -> (-> {:a 1} (assoc :b 1) ;;(assoc map key val) (rena...
/// <summary> /// Defines a student. /// </summary> [DataContract] public class Student { /// <summary> /// Gets or sets the student number. /// </summary> [DataMember] public string StudentNumber { get; set; } /// <summary> ///...
Below code represents an example of Opt-Out approach using Serializable and NonSerialized attributes. /// <summary> /// Represents a student. /// </summary> [Serializable] public class Student { /// <summary> /// Gets or sets student number. /// </summary&gt...
This will be our example data frame: df = pd.DataFrame({"color": ['red', 'blue', 'red', 'blue']}, index=[True, False, True, False]) color True red False blue True red False blue Accessing with .loc df.loc[True] color True red True red ...
This will be our example data frame: color name size 0 red rose big 1 blue violet big 2 red tulip small 3 blue harebell small Using the magic __getitem__ or [] accessor. Giving it a list of True and False of the same length as the dataframe will give you: ...
This will be our example data frame: color name size 0 red rose big 1 blue violet small 2 red tulip small 3 blue harebell small Accessing a single column from a data frame, we can use a simple comparison == to compare every element in the column to the given...
This will be our example data frame: color size name rose red big violet blue small tulip red small harebell blue small We can create a mask based on the index values, just like on a column value. rose_mask = df.index == 'rose' df[rose_mask...
Let's consider this example, that outputs the squares of the numbers 3, 5, and 7: let nums = [3, 5, 7] let squares = nums.map(function (n) { return n * n }) console.log(squares) Run in RunKit The function passed to .map can also be written as arrow function by removing the function keywor...
let [x,y, ...nums] = [0, 1, 2, 3, 4, 5, 6]; console.log(x, y, nums); let {a, b, ...props} = {a:1, b:2, c:3, d:{e:4}} console.log(a, b, props); let dog = {name: 'fido', age: 3}; let {name:n, age} = dog; console.log(n, age);
/* @flow */ function product(a: number, b: number){ return a * b; } const b = 3; let c = [1,2,3,,{}]; let d = 3; import request from 'request'; request('http://dev.markitondemand.com/MODApis/Api/v2/Quote/json?symbol=AAPL', (err, res, payload)=>{ payload = JSON.parse(payload);...
class Mammel { constructor(legs){ this.legs = legs; } eat(){ console.log('eating...'); } static count(){ console.log('static count...'); } } class Dog extends Mammel{ constructor(name, legs){ super(legs); this.name = name; } sleep(){ super...
module.exports = { entry: './src/index', output: { path: __dirname + '/build', filename: 'bundle.js' }, module: { rules: [{ test: /\.tsx?$/, loader: 'ts-loader', exclude: /node_modules/ }] }, res...

Page 1203 of 1336