Skip to content

Instantly share code, notes, and snippets.

Maybe because he tries to use directives to create custom elements too much? I can totally understand. Although that's one of Angular's the biggest selling points, it is also where it sucks the most. It is recommended to put html into a separate resource file then reference to it using templateUrl. Managing these alone will soon become a nightmare if you want to reuse these components.
And CSS for directive - this is a real nightmare. You can't create/expose custom css properties for your element (?!). Let say you have an h1 in your directive and you want to customize it, you will have to give it a custom class. This will lead to many problems. CSS gets leak everywhere. Can't easily set default styling for an element without creating another nightmare with CSS !important. Name will become silly and hard to remember can will easily caused conflict down the road (instead of my-element.label, you will have h1.my-element-label - the former is nicer and won't be affected by a random h1 CSS value somewhere).
Reac
it "should raise exception on GMT command failure" do
FileUtils.makedirs(GmtMapFile::temp_map_dir) unless File.directory?(GmtMapFile::temp_map_dir)
ps_file_name = File.join(GmtMapFile::temp_map_dir, "not enough options.ps")
expect { GmtMap.run "pscoast", ">", ps_file_name }.to raise_error RuntimeError
end
var drawingManager;
var selectedShape;
var colors = ['#1E90FF', '#FF1493', '#32CD32', '#FF8C00', '#4B0082'];
var selectedColor;
var colorButtons = {};
function clearSelection() {
if (selectedShape) {
selectedShape.setEditable(false);
selectedShape = null;
@tobymurray
tobymurray / index.js
Created June 11, 2017 18:24
Express server with PostGraphQL middleware
require('dotenv').config();
const express = require('express');
const postgraphql = require('postgraphql').postgraphql;
const app = express()
const postgresConfig = {
user: process.env.POSTGRES_USERNAME,
password: process.env.POSTGRES_PASSWORD,
host: process.env.POSTGRES_HOST,
@tobymurray
tobymurray / example.ca
Last active July 4, 2017 04:47
nginx configuration with proxy to server
server {
listen 80;
listen [::]:80;
server_name example.ca www.example.ca;
location / {
root /home/toby/client;
index index.html
try_files $uri $uri/ /index.html;
}
@tobymurray
tobymurray / autorest-client-runtime-for-java 1.5.4 pom
Created July 6, 2018 02:58
Mysterious pom.xml for com.microsoft.azure:autorest-clientruntime-for-java:1.5.4<
<!--
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License. See License.txt in the project root for
license information.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.microsoft.azure</groupId>
<artifactId>autorest-clientruntime-for-java</artifactId>
@tobymurray
tobymurray / stacktrace.txt
Created December 2, 2019 20:15
Stacktrace
[java] [main] WARN o.o.c.ignore.CodegenIgnoreProcessor - Output directory does not exist, or is inaccessible. No file (.openapi-generator-ignore) will be evaluated.
[java] [main] INFO o.o.codegen.DefaultGenerator - OpenAPI Generator: java (client)
[java] [main] INFO o.o.codegen.DefaultGenerator - Generator 'java' is considered stable.
[java] [main] INFO o.o.c.languages.AbstractJavaCodegen - Environment variable JAVA_POST_PROCESS_FILE not defined so the Java code may not be properly formatted. To define it, try 'export JAVA_POST_PROCESS_FILE="/usr/local/bin/clang-format -i"' (Linux/Mac)
[java] [main] INFO o.o.c.languages.AbstractJavaCodegen - NOTE: To enable file post-processing, 'enablePostProcessFile' must be set to `true` (--enable-post-process-file for CLI).
[java] [main] INFO o.o.c.languages.AbstractJavaCodegen - Invoker Package Name, originally not set, is now derived from api package name: com.bugreproduction.swagger.client
[java] [main] INFO o.o.c.languages.Abs
@tobymurray
tobymurray / api.yaml
Last active December 2, 2019 20:21
OpenAPI generator regression
swagger: "2.0"
info:
version: "3"
title: API
host: localhost:8443
basePath: /api
schemes:
- https
@tobymurray
tobymurray / sendEmail.js
Last active February 29, 2020 09:23
Send email with Gmail and NodeJS
const fs = require('fs');
const readline = require('readline');
const google = require('googleapis');
const googleAuth = require('google-auth-library');
const Base64 = require('js-base64').Base64;
const SCOPES = ['https://mail.google.com/',
'https://www.googleapis.com/auth/gmail.modify',
'https://www.googleapis.com/auth/gmail.compose',
'https://www.googleapis.com/auth/gmail.send'
@tobymurray
tobymurray / mbedtls-failure.txt
Created July 29, 2020 15:53
idf.py build failure on Ubuntu 18.04
Checking Python dependencies...
Python requirements from /home/toby/esp/esp-idf/requirements.txt are satisfied.
Executing action: all (aliases: build)
Running cmake in directory /home/toby/esp/esp-idf/examples/wifi/smart_config/build
Executing "cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DESP_PLATFORM=1 --warn-uninitialized -DWARN_UNINITIALIZED=1 -DCCACHE_ENABLE=0 /home/toby/esp/esp-idf/examples/wifi/smart_config"...
Warn about uninitialized values.
-- Found Git: /usr/bin/git (found version "2.17.1")
-- IDF_TARGET not set, using default target: esp32
-- The C compiler identification is GNU 8.2.0
-- The CXX compiler identification is GNU 8.2.0