Skip to content

Instantly share code, notes, and snippets.

// https://gist.github.com/theednaffattack/790b3dc87d3c0c02227c2494e5daf15e
import { Button as MyButton, ButtonProps, Text } from "rebass";
import {
borderRadius,
boxShadow,
BorderRadiusProps,
BoxShadowProps,
TLengthStyledSystem
} from "styled-system";
// These are the introspection queries (note POST method) by GraphQL Playground
2019-07-18T22:14:14.319808+00:00 heroku[router]: at=info method=POST path="/graphql" host=eddie-faux-gram.herokuapp.com request_id=458285a3-d959-453b-b259-3440c13647dc fwd="73.70.116.10" dyno=web.1 connect=1ms service=7ms status=500 bytes=429 protocol=https
// These are subscriptions
2019-07-18T22:14:18.412631+00:00 heroku[router]: at=info method=GET path="/subscriptions" host=eddie-faux-gram.herokuapp.com request_id=4c0b335a-a4fc-4906-a899-9ca74c36ff0f fwd="73.70.116.10" dyno=web.1 connect=1ms service=191ms status=101 bytes=165 protocol=http
const React = require("react")
const ReactDOM = require("react-dom")
const Meep = (
<div
style={{ backgroundColor: "blue", fontColor: "white" }}
onClick={() => alert("hello")}
>
Hello world?
</div>
// ROOT/server.js
const express = require("express")
const { renderToString } = require("react-dom/server")
const { ServerStyleSheet } = require("styled-components")
const SSR = require("./static")
const { Meep: ReactSSR } = require("./src/ssr")
// APP_ROOT/server.js
const { Meep: ReactSSR } = require("./src/ssr")
const sheet = new ServerStyleSheet()
try {
const html = renderToString(sheet.collectStyles(<ReactSSR />))
const styleTags = sheet.getStyleTags() // or sheet.getStyleElement();
} catch (error) {
// handle error
@theednaffattack
theednaffattack / README.md
Created October 26, 2017 18:30 — forked from addyosmani/README.md
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

@theednaffattack
theednaffattack / letsencrypt_2017.md
Created August 28, 2017 18:15 — forked from cecilemuller/letsencrypt_2020.md
How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

There are two main modes to run the Let's Encrypt client (called Certbot):

  • Standalone: replaces the webserver to respond to ACME challenges
  • Webroot: needs your webserver to serve challenges from a known folder.

Webroot is better because it doesn't need to replace Nginx (to bind to port 80).

In the following, we're setting up mydomain.com. HTML is served from /var/www/mydomain, and challenges are served from /var/www/letsencrypt.

@theednaffattack
theednaffattack / .gitconfig
Last active July 13, 2017 07:35 — forked from pksunkara/config
Sample of git config file (Example .gitconfig)
[user]
name = Eddie Naff
email = eddienaff@gmail.com
[core]
editor = vim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
excludesfile = ~/.gitignore
[sendemail]
smtpencryption = tls
smtpserver = smtp.gmail.com

Sublime Text 2 - Useful Shortcuts

Tested in Mac OS X: super == command

Open/Goto


  • super+t: go to file
  • super+ctrl+p: go to project
  • super+r: go to methods
// get Data from a URI and then run whatever function we want using that data

function getData(dataURI, thingToRun) {
  var myData = getSomeData();
  thingToRun(myData);
}
// the function we're passing as a callback