Posts

Showing posts from June, 2011

Angular Material Npm Install Code Example

Example 1: install angular material ng add @angular/material Example 2: angular npm angular material npm i @angular/material Example 3: ng add @angular/material npm install --save @angular/material @angular/cdk @angular/animations

Can't Run Firebase Test Lab Tests Using Gcloud And Service Account: 403, Does Not Have Storage.objects.create

Answer : You should be able to use a service account created in the Google Cloud Console. Did your service account have the required project Editor role? (as noted in this doc: https://firebase.google.com/docs/test-lab/continuous) After lots of clicking through the Firebase console and the Google Cloud Console, reading SO, asking for help on Slack, and more trial and error than I care to admit, I discovered that the Firebase console has a service account page: https://console.firebase.google.com/u/0/project/project-name-12345/settings/serviceaccounts/adminsdk That is different from the service accounts page in the Google Cloud Console https://console.cloud.google.com/iam-admin/serviceaccounts/project?project-name-12345 It turns out you want the Firebase service account, you can not create one via the cloud console. Super, super annoying. This is the list of the roles that I put in to my service account : Firebase - Firebase admin ( I think this is overkill. I might upd

Sinonimo De Tratar Code Example

Example: sinonimo de tratar printf ( "Escola" )

Apple - Can't Start Xcode - Stuck On Installing State

Image
Answer : There is a small progress bar under the Launchpad icon in the Menu Bar. You can also see the current download progress by hovering over the icon. Wait for it to end. In the Updates tab of the Apple App Store, after waiting 1 hour for "2 minutes left," I hit CMD+R to refresh and that seemed to "jump start" it. It finished within 60s after that. Could have been coincidence though (YMMV). In launch pad hold the Xcode icon until the X appears and click the X to delete Xcode then go back to the app store and get a fresh copy.

Inline Form In Bootstrap Code Example

Example 1: bootstrap form <form> <div class= "form-group" > <label for= "exampleInputEmail1" >Email address</label> <input type= "email" class= "form-control" id= "exampleInputEmail1" aria-describedby= "emailHelp" placeholder= "Enter email" > <small id= "emailHelp" class= "form-text text-muted" >We'll never share your email with anyone else.</small> </div> <div class= "form-group" > <label for= "exampleInputPassword1" >Password</label> <input type= "password" class= "form-control" id= "exampleInputPassword1" placeholder= "Password" > </div> <div class= "form-group form-check" > <input type= "checkbox" class= "form-check-input" id= "exampleCheck1" > <labe

Accessing IOS Safari Web Inspector From Windows Machine

Image
Answer : It appears to require Safari 6, which has not been released for Windows. Regarding the unavailability of Safari 6 on Windows, Apple has stated "Safari 6 is available for Mountain Lion and Lion. Safari 5 continues to be available for Windows." I regularly use weinre . It basically runs a webserver that in turn acts as an inspector-enhanced proxy to browse webpages and websites. The inspector can be started by adding a script to your page or running a bookmarklet. weinre is a debugger for web pages, like FireBug (for FireFox) and Web Inspector (for WebKit-based browsers), except it's designed to work remotely, and in particular, to allow you debug web pages on a mobile device such as a phone. To install it, you will need NodeJS and NPM (included with NodeJS). You will also need a WebKit-based browser on the desktop/receiver end (Safari, Google Chrome, or Chromium). It should work on Windows, OSX, and Linux. Official page: https://people.apache.org/~p

Angular2 NgModelChange Previous Value

Answer : What you can do is, DEMO : http://plnkr.co/edit/RXJ4D0YJrgebzYcEiaSR?p=preview <input type="text" [ngModel]="text" //<<<###changed [(ngModel)]="text" to [ngModel]="text" (ngModelChange)="textChanged($event)"> private textChanged(event) { console.log('changed', this.text, event); this.text=event; //<<<###added } So found kinda weird(at least for me) possible solution for this with least changes in the code in question. So on assigning the (ngModelChange) attribute before [(ngModel)] what I get is following with the same handler: changed *older value* *new value* I get the new value in this.text like so: setTimeout(() => console.log(this.text), 0); all you need to do is to put (ngModelChange)="textChanged($event)" to the left of [(ngModel)] element in the html tag, like: <input (whateve

Can Anyone Explain Laravel 5.2 Multi Auth With Example

Answer : After lots of digging and lots of questions & answers I have finally managed to work Laravel 5.2 Multi Auth with two table, So I'm writing Answer of my own Question. How to implement Multi Auth in Larvel 5.2 As Mentioned above. Two table admin and users Laravel 5.2 has a new artisan command. php artisan make:auth it will generate basic login/register route , view and controller for user table. Make a admin table as users table for simplicity. Controller For Admin app/Http/Controllers/AdminAuth/AuthController app/Http/Controllers/AdminAuth/PasswordController (note: I just copied these files from app/Http/Controllers/Auth/AuthController here) config/auth.php //Authenticating guards 'guards' => [ 'user' =>[ 'driver' => 'session', 'provider' => 'user', ], 'admin' => [ 'driver' => 'session', 'pro

Tailwind Text 5xl Line Height Code Example

Example: line-height tailwind .leading-none - line-height : 1 ; .leading-tight - line-height : 1.25 ; .leading-snug - line-height : 1.375 ; .leading-normal - line-height : 1.5 ; .leading-relaxed - line-height : 1.625 ; .leading-loose - line-height : 2 ;

Dotnet Tool Restore Code Example

Example: dotnet restore dotnet restore [ < ROOT > ] [ -- configfile < FILE > ] [ -- disable - parallel ] [ - f | -- force ] [ -- force - evaluate ] [ -- ignore - failed - sources ] [ -- interactive ] [ -- lock - file - path < LOCK_FILE_PATH > ] [ -- locked - mode ] [ -- no - cache ] [ -- no - dependencies ] [ -- packages < PACKAGES_DIRECTORY > ] [ - r | -- runtime < RUNTIME_IDENTIFIER > ] [ - s | -- source < SOURCE > ] [ -- use - lock - file ] [ - v | -- verbosity < LEVEL > ] dotnet restore - h | -- help

10 Minute Timer Code Example

Example: 20 minute timer for good eyesight every 20 minutes look out the window at something 20 feet away for 20 seconds

C# Pass By Value Vs. Pass By Reference

Image
Answer : Re: OP's Assertion It is universally acknowledged (in C# at least) that when you pass by reference, the method contains a reference to the object being manipulated, whereas when you pass by value, the method copies the value being manipulated ... TL;DR There's more to it than that. Unless you pass variables with the ref or out keywords, C# passes variables to methods by value , irrespective of whether the variable is a value type or a reference type . If passed by reference , then the called function may change the variable's address (i.e. change the original calling function's variable's assignment). If a variable is passed by value : if the called function re-assigns the variable, this change is local to the called function only, and will not affect the original variable in the calling function however, if changes are made to the variable's fields or properties by the called function, it will depend on whether the variable is

How To Call Oncollisionenter Unity Code Example

Example 1: unity oncollisionenter void OnCollisionEnter ( Collision col ) { //This method will run when your game object //collides with something Debug . Log ( "Collided" ) ; } Example 2: oncollisionenter unity void OnCollisionEnter ( Collision collision ) { if ( collision . gameObject . tag == "Door" ) { // DoorScript is the name you gave to the script on the door DoorScript script = collision . gameObject . GetComponent < DoorScript > ( ) ; // OpenDoor is a method in your door object's script script . OpenDoor ( ) ; } }

Convert 60 Cm To Feet Code Example

Example: cm to foot 1 cm = 0.032808399 foot

Convert Excel To Csv In Python Code Example

Example 1: Convert Excel to CSV using Python import pandas as pd data_xls = pd.read_excel('excelfile.xlsx', 'Sheet2', dtype=str, index_col=None) data_xls.to_csv('csvfile.csv', encoding='utf-8', index=False) Example 2: convert all excel files in folder to csv python import pandas as pd import os import glob source="D:\\source\\" dest='D:\\dest\\' os.chdir(source) for file in glob.glob("*.xls"): df = pd.read_excel(file) df.to_csv(dest+file+'.csv', index=False) os.remove(file) for file in glob.glob("*.xlsx"): df = pd.read_excel(file) df.to_csv(dest+file+'.csv', index=False) os.remove(file) Example 3: convert excel to csv #UI File>> Save As>> Rename the file .csv>> Save #Online https://www.zamzar.com/convert/xls-to-csv/

Bootstrap Heading Examples

Example: bootstrap heading h1. Bootstrap heading h2. Bootstrap heading h3. Bootstrap heading h4. Bootstrap heading h5. Bootstrap heading h6. Bootstrap heading