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 hacker rank problems.ts
function countingValleys(n, s) {
let seaLevel = 0;
let currLevel = 0;
let valleys = 0;
s = s.split('');
for (let i = 0; i < s.length; i++) {
//update the current level
if (s[i] === 'U') {
currLevel += 1;
View duotone.ganymede.css
Name: Duotone Ganymede
:root {
--keyword: #3274a9;
--tag: #e2a500;
--prev-normal: #4a5f78;
--normal: #143550;
--script: #e56353;
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 /
Last active Aug 15, 2018
I Just Can't with CSS Anymore
title date excerpt
I Just Can't with CSS Anymore
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 / modal.js
Created Aug 8, 2018
Some old modal thing i had sitting on my desktop
View modal.js
class Modal {
constructor () {
settings () {
return {
open: '.modalOpen',
close: '.modalClose',
View class.js
class Something {
static reporter() {
privateVar = false
privateMethod = (x) => Boolean(x) && !== this.update(x)
update = (x) => this.privateVar = x
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"
"": false,
"editor.minimap.enabled": false,
"git.ignoreMissingGitWarning": true,
You can’t perform that action at this time.