Skip to content

Instantly share code, notes, and snippets.

View EcutDavid's full-sized avatar
📚

David Guan EcutDavid

📚
View GitHub Profile
@EcutDavid
EcutDavid / reset.scss
Created September 24, 2015 05:16 — forked from HamptonMakes/reset.scss
Reset SCSS
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
https://vimeo.com/138613664 Why Should I Care About Immutable Data In ReactJS
@EcutDavid
EcutDavid / NodeTips.MD
Last active October 8, 2015 05:33
Node programming tips.

Common question

express

  • trust proxy: Set trust proxy to true if your Node.js app is working behind reverse proxy such as Varnish or Nginx. This will permit trusting in the X-Forwarded-* headers, such as X-Forwarded-Proto (req.protocol) or X-Forwarder-For (req.ips). The trust proxy setting is disabled by default.
app.set('trust proxy', true);  //same result
app.enable('trust proxy');//same result

Image

GIF (Graphics Interchange Format) files provide good compression for images that have areas of solid color: logos, text, simple banners, and so on. GIFs also offer single-color transparency, meaning that you can make one color in the graphic disappear, permitting the background of a web page to show through part of the image. In addition, GIFs can include simple animations.posterized (patchy and unrealistically colored, like a poster). In other words, that radiant sunset photo you took with your digital camera won’t look so good as a GIF.
JPEG (Joint Photographic Experts Group) graphics, on the other hand, pick up where GIFs leave off. JPEG graphics can contain millions of different colors, making them ideal for photos. Not only do JPEGs do a better job on photos, they also compress multicolored images much better than GIFs, because the JPEG compression algorithm considers how the human eye perceives different adjacent color values. JPEG is the format many cameras use to save photos. When your g

@EcutDavid
EcutDavid / Css tips.MD
Last active October 22, 2015 07:07
summary of css

Fluid background, fixed content

.wrapper { max-width: 900px; margin: 1em calc(50% - 450px); }

Transition

The heart of CSS transitions are four properties that control which properties to animate, how long the animation takes, the type of animation used, and an optional delay before the animation begins.

SCSS Tips

Reverse proxy

A reverse proxy is a type of proxy server that retrieves resources on behalf of a client from one or more servers. These resources are then returned to the client as though they originated from the proxy server itself.[1] While a forward proxy acts as an intermediary for its associated clients to contact any server, a reverse proxy acts as an intermediary for its associated servers to be contacted by any client.