Skip to content

Instantly share code, notes, and snippets.

View semlinker's full-sized avatar
👊
Fighting

阿宝哥 semlinker

👊
Fighting
View GitHub Profile
/* styles for '...' */
.block-with-text {
/* hide text if it more than N lines */
overflow: hidden;
/* for set '...' in absolute position */
position: relative;
/* use this value to count block height */
line-height: 1.2em;
/* max-height = line-height (1.2) * lines max number (3) */
max-height: 3.6em;
@semlinker
semlinker / ignore.md
Created August 24, 2016 16:32 — forked from tmaybe/ignore.md
ignoring merge conflicts for specific files in a git repository

How to Ignore Merge Conflicts for Specific Files in a Git Repository

Create a directory and git init it

$ mkdir merge-test
$ cd merge-test/
$ git init
@semlinker
semlinker / introrx.md
Created October 23, 2016 15:57 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
import { Component, Input } from '@angular/core';
import { FormControl } from '@angular/forms';
import { ValidationService } from './validation.service';
@Component({
selector: 'exe-control-messages',
template: `
<div *ngIf="errorMessage">
<span>{{ errorMessage.message }}</span>
.markdown-here-wrapper{font-size:17px; line-height:30px;}
pre, code{font-size:14px; font-family: Roboto, 'Courier New', Consolas, Inconsolata, Courier, monospace;}
code{margin:0 3px; padding:0 6px; white-space: pre-wrap; background-color:#F8F8F8; border-radius:2px; display: inline;}
pre{font-size:15px; line-height:20px;}precode{ white-space: pre; overflow: auto; border-radius:3px; padding:5px10px; display: block !important;}
strong, b{color:#BF360C;}
em, i{color:#009688;}
big{font-size:22px; color:#009688; font-weight: bold; vertical-align: middle; border-bottom:1px solid #eee;}
small{font-size:12px; line-height:22px;}
hr{border-bottom:0.05em dotted #eee; margin:10px auto;}
p{margin:15px 5px!important;}
/**
* 说明信息
* 1.目录结构:
* ├── avatar.jpg
* ├── qrcode.jpg
* ├── share-image.js
* ├── simhei.ttf
* └── template.jpg
* 2.备注:若出现资源路径异常时,则使用path.join(__dirname, "./simhei.ttf")的方式进行资源加载
* 3.示例:
@semlinker
semlinker / index.html
Last active January 20, 2018 12:17
PWA 学习笔记之 Web Notifications API Demo
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Web Notifications API</title>
</head>
<body>
<button id="notificationsBtn">发送通知</button>
<script>
document.addEventListener('DOMContentLoaded', initNotification, false);
@semlinker
semlinker / webkit-pseudo-elements.md
Created February 9, 2018 10:41 — forked from leostratus/webkit-pseudo-elements.md
Webkit Pseudo-Element Selectors (Shadow DOM Elements)

An ongoing project to catalogue all of these sneaky, hidden, bleeding edge selectors as I prepare my JSConf EU 2012 talk.

Everything is broken up by tag, but within each the selectors aren't particularly ordered.

I have not tested/verified all of these. Have I missed some or got it wrong? Let me know. - A

A friendly reminder that you may need to set this property on your target/selected element to get the styling results you want:

-webkit-appearance:none;

@semlinker
semlinker / rxjs-diagrams.md
Created May 16, 2018 07:01 — forked from PCreations/rxjs-diagrams.md
Super Intuitive Interactive Diagrams to learn combining RxJS sequences by Max NgWizard K
@semlinker
semlinker / shadow-dom.md
Created November 1, 2018 07:51 — forked from praveenpuglia/shadow-dom.md
Everything you need to know about Shadow DOM

I am moving this gist to a github repo so more people can contribute to it. Also, it makes it easier for me to version control.

Please go to - https://github.com/praveenpuglia/shadow-dom-in-depth for latest version of this document. Also, if you find the document useful, please shower your love, go ⭐️ it. :)

Shadow DOM

Heads Up! It's all about the V1 Spec.

In a nutshell, Shadow DOM enables local scoping for HTML & CSS.