Skip to content

Instantly share code, notes, and snippets.

🔥
...

Charles ⚡ charliewilco

🔥
...
Block or report user

Report or block charliewilco

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View duotone.ganymede.css
/*
Name: Duotone Ganymede
*/
:root {
--keyword: #3274a9;
--tag: #e2a500;
--prev-normal: #4a5f78;
--normal: #143550;
--script: #e56353;
@charliewilco
charliewilco / night-mode.js
Created Oct 12, 2018
Night Mode + Localstorage
View night-mode.js
import React from "react";
const Night = React.createContext({});
export class NightModeProvider extends React.Component {
static defaultProps = {
className: "NightMode"
};
state = {
View Dockerfile
FROM mhart/alpine-node:10
WORKDIR /usr/src/app
COPY package.json ./
# # add files to container
# ADD . /app
# # specify the working directory
View cookies.js
function NodeCookieParser(req) {
let cookies = {};
req.headers.cookie &&
req.headers.cookie.split(";").forEach(function(cookie) {
let parts = cookie.split("=");
cookies[parts[0].trim()] = (parts[1] || "").trim();
});
return cookies
}
View compose.js
const compose = (...fns) => fns.reduce((f, g) => (...args) => f(g(...args)))
@charliewilco
charliewilco / css.md
Last active Aug 15, 2018
I Just Can't with CSS Anymore
View css.md
title date excerpt
I Just Can't with CSS Anymore
2018-08-08
Okay, CSS. Like seriously. Come on

Four years ago, I worked at an agency and oh my did I write a lot of CSS. From project to project, a lot of CSS would have a lot of commonality. Patterns emerged, I needed custom buttons, a page wrapper, a flexible grid system, a type scale. I open sourced them on GitHub (because who hasn't ran down that rabbit-hole in the name of GitHub stars and immortality) and made them easy for me to find and update (well not so much update). A started to find that I'd need these in almost ever project I touched, from job to job. A lot of these patterns never changed much.

In building these patterns, I found the language underneath really rigid to work with and the environment pretty unintuitive. A lot projects tried to fix this and no matter what preprocessor or abstraction came along, the underlying problems remained:

@charliewilco
charliewilco / modal.js
Created Aug 8, 2018
Some old modal thing i had sitting on my desktop
View modal.js
class Modal {
constructor () {
this.open()
this.close()
}
settings () {
return {
open: '.modalOpen',
close: '.modalClose',
View class.js
class Something {
static reporter() {
console.log('hello')
}
privateVar = false
privateMethod = (x) => Boolean(x) && !== this.update(x)
update = (x) => this.privateVar = x
@charliewilco
charliewilco / .vscode.settings.json
Last active Jan 23, 2019
Oceanic Custom VSCode
View .vscode.settings.json
{
"editor.fontFamily": "Operator Mono, monospace",
"editor.fontWeight": "300",
"workbench.colorTheme": "Ocean Dark Extended",
"workbench.colorCustomizations": {
"statusBar.background": "#343d46"
},
"workbench.statusBar.feedback.visible": false,
"editor.minimap.enabled": false,
"git.ignoreMissingGitWarning": true,
View Content.jsx
import React, { Component, Fragment } from 'react'
import 'universal-fetch'
export default class extends Component {
static async getInitialProps({ match, prefetch }) {
const { user, repo } = match.params
const response = await fetch(`https://api.github.com/repos/${user}/${repo}`)
const post = await response.json()
return { post, user, repo };
You can’t perform that action at this time.