Skip to content

Instantly share code, notes, and snippets.

View romain130492's full-sized avatar

Rouiller Romain romain130492

View GitHub Profile
@romain130492
romain130492 / Async Function
Last active February 24, 2020 14:23
Async Function
init(){
that =this;
async function run() {
await that.createIsoFromCurrentDay()
await that.checkIfEvent()
await that.getOlderEvent()
await that.orderEventsByTime()
}
run()
}
@romain130492
romain130492 / Conditionnal in variable
Last active February 24, 2020 14:24
Conditionnal in variable
arrayDayEvents.length == 0
? (this.noEvent = true)
: (this.noEvent = false)
Shorter Version
this.noEvent = arrayDayEvents.length == 0
$ git remote rm origin
$ git remote add origin git@github.com:aplikacjainfo/proj1.git
$ git config master.remote origin
$ git config master.merge refs/heads/master
@romain130492
romain130492 / equals_operators.md
Last active February 29, 2020 05:30
Equals operators (==) VS (===) - Javascript
  • (==)(!=) (==)(!=) considers the value but not the type

Example :

0=='0'  //==> True
  • (===)(!==)
@romain130492
romain130492 / Computed_property_return.md
Last active February 29, 2020 06:40
Computed property return statement
computed_property() {
      this.variable = new Date(this.currentUtc)
      return this.variable
    }
   const variable2 = this.computed_property()

OR more simply

computed_property() {
@romain130492
romain130492 / dayJs_set_iso_date_time.md
Last active March 1, 2020 04:25
day.js Set an ISO with a specific date & time & UTC
  • Import Modules
import dayjs from 'dayjs'
var utc = require('dayjs/plugin/utc')
dayjs.extend(utc)
  • Date and input User
 
@romain130492
romain130492 / jest-parent-component-inject.md
Created March 3, 2020 04:14
Jest Inject and provide() method

Jest

inject data with provide

import UserTest from './seed/user-test'
import { createLocalVue, shallowMount, mount } from '@vue/test-utils'
import Component from '../dist'
const user = UserTest.user;
const userToken = UserTest.userToken;
@romain130492
romain130492 / differences.md
Last active April 7, 2020 02:26
Const vs Let vs Var - #Javascript
  • Redefining :

Const ==> Constant : Cannot be reassign. Example :

const name='Romain';
name='Thomas'
console.log(name) ==> Error   

Const cannot be reassigned but can be manipulated

@romain130492
romain130492 / selenium-python-scraping.md
Last active April 7, 2020 02:26
#Selenium #Python #Scraping - wait

Scraping with Selenium/ Python

Wait to get an element on the page

    driver = webdriver.Firefox(firefox_options=options,
 executable_path=geckodriver)
@romain130492
romain130492 / Programmatic-Navigation.md
Last active April 7, 2020 02:26
#vue Programmatic Navigation

Programmatic Navigation

To go back to the last page visited

this.$route(-1)

<a @click="$router.go(-1)">back</a>