Skip to content

Instantly share code, notes, and snippets.

View nufaylr's full-sized avatar

Nufayl Razick nufaylr

View GitHub Profile
nufaylr / icon.js
Created November 26, 2019 08:42 — forked from evansiroky/icon.js
Mocking children components with Jest - does this make sense?
View icon.js
import React from 'react'
export default class Icon extends React.Component {
render () {
const {type, className} = this.props
return (
className={`fa fa-${type} fa-fw ${className}`}
nufaylr / 01-simple.test.js
Created November 26, 2019 08:41 — forked from a-h/01-simple.test.js
Testing styled Material UI components with Enzyme
View 01-simple.test.js
import React from 'react';
import { shallow } from 'enzyme';
const Item = text => <p>Item {text}</p>;
const Composition = ({ showB }) => (
<Item text="A" />
{showB && <Item text="B" />}
nufaylr / .bashrc
Created June 13, 2019 10:24
Show Git Branch
View .bashrc
# Show Git Branch
git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
export PS1="[\u@\h \W]\[\033[00;32m\]\$(git_branch)\[\033[00m\]\$ "
nufaylr / webpack.config.js
Created May 15, 2019 10:13 — forked from colbycheeze/webpack.config.js
Storybook config
View webpack.config.js
const webpack = require('webpack')
const path = require('path')
const cssnano = require('cssnano')
const BASE_PATH = '..'
const resolvePath = subPath => path.resolve(__dirname, `${BASE_PATH}/${subPath}`)
const env = process.env.NODE_ENV || 'development'
/* eslint-disable */
View tmux_cheatsheet.markdown

tmux cheatsheet

As configured in my dotfiles.

start new:


start new with session name:

nufaylr /
Created June 18, 2018 13:51 — forked from squarism/
iterm2 cheatsheet

Tabs and Windows

Function Shortcut
Fullscreen + Enter
Previous Tab + Left Arrow
Next Tab + Right Arrow
Go to Tab + Number
Go to Window + Option + Number
Go to Split Pane by Direction + Option + Arrow
nufaylr /
Created March 1, 2018 10:45 — forked from parmentf/
Git Commit message Emoji
nufaylr /
Created November 15, 2017 18:13 — forked from jareware/
Advanced SCSS, or, 16 cool things you may not have known your stylesheets could do

⇐ back to the gist-blog at

Advanced SCSS

Or, 16 cool things you may not have known your stylesheets could do. I'd rather have kept it to a nice round number like 10, but they just kept coming. Sorry.

I've been using SCSS/SASS for most of my styling work since 2009, and I'm a huge fan of Compass (by the great @chriseppstein). It really helped many of us through the darkest cross-browser crap. Even though browsers are increasingly playing nice with CSS, another problem has become very topical: managing the complexity in stylesheets as our in-browser apps get larger and larger. SCSS is an indispensable tool for dealing with this.

This isn't an introduction to the language by a long shot; many things probably won't make sense unless you have some SCSS under your belt already. That said, if you're not yet comfy with the basics, check out the aweso

nufaylr /
Created October 5, 2017 08:37 — forked from Kartones/
PostgreSQL command line cheatsheet


Magic words:

psql -U postgres

Some interesting flags (to see all, use -h):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
nufaylr / app.js
Created July 15, 2017 10:20 — forked from morontt/app.js
twig.js inline template
View app.js
var html = twig({ ref: "user-profile" }).render({
list: ["a", "b", "c"]