Skip to content

Instantly share code, notes, and snippets.

View AndrejsAbrickis's full-sized avatar
🎾

Andrejs Abrickis AndrejsAbrickis

🎾
View GitHub Profile
<template>
<button type="button" @click="handleClick">{{ label }}</button>
</template>
<script>
export default {
name: "ButtonIncrease",
props: {
count: Number,
label: String
<template>
<div id="app">
<p>Count: {{ count }}</p>
<div>
<ButtonDecrease
:label="labels.decrease"
:count="count"
@buttonClicked="handleDecrease"
/>
<ButtonIncrease
/// <reference path="./node_modules/lighthouse/typings/externs.d.ts"/>
import * as fs from 'fs';
import * as chromeLauncher from 'chrome-launcher';
import lighthouse from 'lighthouse/lighthouse-core';
import ReportGenerator from 'lighthouse/lighthouse-core/report/report-generator';
const run = async (url: string, options: chromeLauncher.Options) => {
const chrome: chromeLauncher.LaunchedChrome = await chromeLauncher.launch({ chromeFlags: options.chromeFlags });
options.port = chrome.port;
const CSS = [
'jquery-ui-dist/jquery-ui.min.css',
'jquery-datetimepicker/jquery.datetimepicker.css'
];
const JS = [
'jquery-ui-dist/jquery-ui.min.js',
'jquery-datetimepicker/jquery.datetimepicker.min.js',
'jquery/dist/jquery.min.js',
'lodash/lodash.min.js'
];
@AndrejsAbrickis
AndrejsAbrickis / .bowerrc
Last active March 20, 2019 00:35
Migrate from bower to webpack
{
"directory": "wwwroot/scripts/bower"
}
<template>
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
>
<path :d="path" />
</svg>
</template>
const axios = require('axios');
const cheerio = require('cheerio');
(async () => {
try {
const response = await axios.get('https://bvopen.abrickis.me/#/standings');
const $ = cheerio.load(response.data);
console.log($('body').html());
} catch (error) {
const puppeteer = require('puppeteer');
(async () => {
try {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto('https://bvopen.abrickis.me/#/standings');
await page.waitForSelector('.category', { timeout: 1000 });
const body = await page.evaluate(() => {
@AndrejsAbrickis
AndrejsAbrickis / package.json
Last active June 12, 2017 18:57
package.json
{
"name": "bower-to-webpack",
"description": "Bye bye Bower! Or how to migrate from Bower to npm and Webpack",
"author": "Andrejs Abrickis",
"dependencies": {
"jquery": "^2.1.4",
"jquery-datetimepicker": "https://github.com/xdan/datetimepicker/archive/2.5.4.tar.gz",
"jquery-ui-dist": "^1.12.1",
"lodash": "^4.17.2"
},
@AndrejsAbrickis
AndrejsAbrickis / webpack.config.js
Last active June 12, 2017 18:34
Bower to webpack
const path = require('path');
const webpack = require('webpack');
const CopyWebpackPlugin = require('copy-webpack-plugin');
// assets.js
const Assets = require('./assets');
module.exports = {
entry: {
app: "./app.js",