This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* this */ | |
p { | |
color: blue; | |
font-family: sans-serif; | |
font-size: 16px; | |
font-weight: 400; | |
line-height: 24px; | |
padding-left: 8px; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Embarrassing edit: I used the wrong comment style for CSS files... */ | |
/* | |
CSS can live in its own file, which is imported by the html document. Importing this | |
stylesheet into an html doc would look something like this (provided the html doc and | |
the example.css file live in the same directory on your local system): | |
<html lang="en"> | |
<head> | |
<link rel="stylesheet" type="text/css" href="example.css"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- You can save this file locally and open it in your browser for experimentation purposes. --> | |
<html lang="en"> | |
<head> | |
<!-- | |
Loads of other stuff lives in the <head> tag, <style> | |
blocks are just one of many possibilities. Also, multiple <style> | |
blocks are not uncommon. | |
--> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.Rule = class Rule extends Lint.Rules.AbstractRule { | |
apply(sourceFile) { | |
return this.applyWithWalker(new NoTemplateExpressionWalker(sourceFile, this.getOptions())); | |
} | |
}; | |
const FAILURE_STRING = `Use parameter properties instead of assigning to members in the constructor body.`; | |
class NoTemplateExpressionWalker extends Lint.RuleWalker { | |
walk(sf) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.Rule = class Rule extends Lint.Rules.AbstractRule { | |
apply(sourceFile) { | |
return this.applyWithWalker(new NoTemplateExpressionWalker(sourceFile, this.getOptions())); | |
} | |
}; | |
class NoTemplateExpressionWalker extends Lint.RuleWalker { | |
FAILURE_STRING = "Prefix boolean method and property names with words like 'is' or 'has'"; | |
PREFIXES = ["is", "has", "will", "should", "could"]; | |
visitClassDeclaration(node) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<style> | |
button:focus { | |
outline: none; | |
} | |
button.success { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as ts from "typescript"; | |
import * as Lint from "../index"; | |
export class Rule extends Lint.Rules.AbstractRule { | |
public static FAILURE_STRING_FACTORY(nodeType: string) { | |
return `Usage of ${nodeType} has been disallowed.`; | |
} | |
public apply(sourceFile: ts.SourceFile): Lint.RuleFailure[] { | |
return this.applyWithWalker( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <sys/socket.h> | |
#include <string.h> | |
#include <netinet/in.h> | |
#include <arpa/inet.h> | |
#include <stdio.h> | |
#define MULTICAST_PORT 1982 | |
#define MULTICAST_HOST "239.255.255.250" | |
#define UDP_PORT 33333 | |
#define BUFFER_SIZE 1250 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stdio.h> | |
#include <sys/socket.h> | |
#include <sys/types.h> | |
#include <netinet/in.h> | |
#include <string.h> | |
#include <arpa/inet.h> | |
#include <netdb.h> | |
#define RESPONSE_BUFFER 1200 |