Skip to content

Instantly share code, notes, and snippets.

View AndrejsAbrickis's full-sized avatar
🎾

Andrejs Abrickis AndrejsAbrickis

🎾
View GitHub Profile
@AndrejsAbrickis
AndrejsAbrickis / trello-css-guide.md
Last active August 29, 2015 14:27 — forked from bobbygrace/trello-css-guide.md
Trello CSS Guide

Trello CSS Guide

“I perfectly understand our CSS. I never have any issues with cascading rules. I never have to use !important or inline styles. Even though somebody else wrote this bit of CSS, I know exactly how it works and how to extend it. Fixes are easy! I have a hard time breaking our CSS. I know exactly where to put new CSS. We use all of our CSS and it’s pretty small overall. When I delete a template, I know the exact corresponding CSS file and I can delete it all at once. Nothing gets left behind.”

You often hear updog saying stuff like this. Who’s updog? Not much, who is up with you?

This is where any fun you might have been having ends. Now it’s time to get serious and talk about rules.

Writing CSS is hard. Even if you know all the intricacies of position and float and overflow and z-index, it’s easy to end up with spaghetti code where you need inline styles, !important rules, unused cruft, and general confusion. This guide provides some architecture for writing CSS so it stays clean and ma

/* Some CSS reset */
* {
box-sizing: border-box;
}
/* Base styles to make it look a bit more like table */
.headings,
.row {
border: 1px solid #ddd;
}
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div class="container">
<div class="row-container headings">
<div class="cell wider fixed"><br><br></div>
@AndrejsAbrickis
AndrejsAbrickis / bower.json
Created June 12, 2017 17:24
Bower to webpack
{
"name": "bower-to-webpack",
"dependencies": {
"datetimepicker": "~2.5.4",
"jquery": "~2.1.4",
"jquery-ui": "~1.11.2",
"lodash": "^4.17.2"
}
}
@AndrejsAbrickis
AndrejsAbrickis / CopyWebpackPlugin
Last active June 12, 2017 17:48
CopyWebpackPlugin
new CopyWebpackPlugin([
{
from: './source/script_a.js',
to: './target'
},
{
from: './source/css_a.js',
to: './target'
}
])
@AndrejsAbrickis
AndrejsAbrickis / .bowerrc
Last active June 12, 2017 18:32
Bower to webpack
{
"directory": "wwwroot/bower"
}
@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",
@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"
},
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(() => {
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) {