Skip to content

Instantly share code, notes, and snippets.

View nufaylr's full-sized avatar
👋

Nufayl Razick nufaylr

👋
View GitHub Profile
@nufaylr
nufaylr / icon.js
Created November 26, 2019 08:42 — forked from evansiroky/icon.js
Mocking children components with Jest - does this make sense?
import React from 'react'
export default class Icon extends React.Component {
render () {
const {type, className} = this.props
return (
<i
className={`fa fa-${type} fa-fw ${className}`}
{...this.props}
@nufaylr
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
import React from 'react';
import { shallow } from 'enzyme';
const Item = text => <p>Item {text}</p>;
const Composition = ({ showB }) => (
<p>
<Item text="A" />
{showB && <Item text="B" />}
</p>);
@nufaylr
nufaylr / .bashrc
Created June 13, 2019 10:24
Show Git Branch
# 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
nufaylr / webpack.config.js
Created May 15, 2019 10:13 — forked from colbycheeze/webpack.config.js
Storybook config
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 */

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@nufaylr
nufaylr / iterm2.md
Created June 18, 2018 13:51 — forked from squarism/iterm2.md
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
nufaylr / GitCommitEmoji.md
Created March 1, 2018 10:45 — forked from parmentf/GitCommitEmoji.md
Git Commit message Emoji
@nufaylr
nufaylr / SCSS.md
Created November 15, 2017 18:13 — forked from jareware/SCSS.md
Advanced SCSS, or, 16 cool things you may not have known your stylesheets could do

⇐ back to the gist-blog at jrw.fi

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
nufaylr / postgres-cheatsheet.md
Created October 5, 2017 08:37 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

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
nufaylr / app.js
Created July 15, 2017 10:20 — forked from morontt/app.js
twig.js inline template
var html = twig({ ref: "user-profile" }).render({
list: ["a", "b", "c"]
});