Skip to content

Instantly share code, notes, and snippets.

View lizzymendivil's full-sized avatar

Lizzy Mendivil lizzymendivil

View GitHub Profile
@lizzymendivil
lizzymendivil / insert.json
Last active October 17, 2019 22:09
mongo-insert-with-custom-objectId
db.businessunits.insert(
[
{_id: ObjectId("000000000000000000000001"), name: "lizzy", phoneNumber: "61368424", email: "[email protected]", state: "active", createdDate: new Date()},
{_id: ObjectId("000000000000000000000002"), name: "melissa", phoneNumber: "63489125", email: "[email protected]", state: "active", createdDate: new Date()},
{_id: ObjectId("000000000000000000000003"), name: "ericka", phoneNumber: "78996235", email: "[email protected]", state: "active", createdDate: new Date()},
{_id: ObjectId("000000000000000000000004"), name: "sandra", phoneNumber: "78961254", email: "[email protected]", state: "active", createdDate: new Date()}
]
)
@lizzymendivil
lizzymendivil / filter.html
Created May 16, 2019 18:25
input file accept presentations
<input id="media-file-upload"
class="input-upload"
type="file"
nv-file-select=""
uploader="mediaListCtrl.uploader"
accept="application/vnd.ms-powerpoint,
application/vnd.openxmlformats-officedocument.presentationml.slideshow,
application/vnd.openxmlformats-officedocument.presentationml.presentation"
multiple/>
@lizzymendivil
lizzymendivil / index.js
Created March 19, 2019 18:06
togglePassword function
togglePassword() {
this.typePassword = !this.typePassword;
}
@lizzymendivil
lizzymendivil / index.html
Last active March 19, 2019 18:10
input password show or hide value
<md-dialog-content>
<div class="md-dialog-content-bu">
<p class="md-body-2">{{ 'main.business_units.delete.CONFIRM' | translate }}</p>
<md-input-container class="md-block">
<label>{{ 'main.business_units.delete.ENTER_PASSWORD' | translate }}</label>
<input id="business-unit-name-input"
name="password"
type="{{ businessUnitDeleteFormController.typePassword ? 'text' : 'password' }}"
ng-model="businessUnitDeleteFormController.password"
required
@lizzymendivil
lizzymendivil / app.component.html
Created February 13, 2019 13:09
ngx-translate-app.component.html
<div class="mr-5 mb-5 d-flex justify-content-end">
<button class="mr-2 btn bg-danger text-white text-uppercase" (click)="switchLanguage('en')">{{ 'demo.english' | translate
}}</button>
<button class="btn bg-danger text-white text-uppercase" (click)="switchLanguage('es')">{{ 'demo.spanish' | translate }}</button>
</div>
@lizzymendivil
lizzymendivil / en.json
Created February 13, 2019 13:02
ngx-translate-en-json
{
"demo":
{
"by": "By Lizzy Mendivil",
"english": "English",
"forgot_password": "Forgot password?",
"not_member": "Not a member?",
"password": "Password",
"remember": "Remember me",
"signin": "Sign in",
@lizzymendivil
lizzymendivil / app.component.ts
Created February 13, 2019 12:57
ngx-translate app.component.ts
import { Component } from '@angular/core';
import {TranslateService} from '@ngx-translate/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
@lizzymendivil
lizzymendivil / app.module.ts
Created February 13, 2019 01:47
ngx-translate-app-module
import { BrowserModule } from '@angular/platform-browser';
import {HttpClient, HttpClientModule} from '@angular/common/http';
import { NgModule } from '@angular/core';
import {TranslateModule, TranslateLoader} from '@ngx-translate/core';
import {TranslateHttpLoader} from '@ngx-translate/http-loader';
import { AppComponent } from './app.component';
export function HttpLoaderFactory(http: HttpClient) {
export function flattenMessages(nestedMessages, prefix = '') {
return Object.keys(nestedMessages).reduce((messages, key) => {
const value = nestedMessages[key];
const prefixedKey = prefix ? `${prefix}.${key}` : key;
if (typeof value === 'string') {
messages[prefixedKey] = value;
} else {
Object.assign(messages, flattenMessages(value, prefixedKey));
}
return messages;
import { FormattedMessage } from 'react-intl';
.
.
.
<Grid container={true} alignItems='center'>
<Grid item={true} xs={6}>
<FormControlLabel
classes={{root: this.props.classes.rememberText}}
control={<Checkbox color='primary' />}
label={<FormattedMessage id="sign.in.remember.me" />}