Skip to content

Instantly share code, notes, and snippets.

Avatar

Rob Wierzbowski robwierzbowski

View GitHub Profile
@robwierzbowski
robwierzbowski / gitcreate.sh
Last active Feb 20, 2021
A simple litte script. Create and push to a new github repo from the command line.
View gitcreate.sh
#!/bin/bash
# https://gist.github.com/robwierzbowski/5430952/
# Create and push to a new github repo from the command line.
# Grabs sensible defaults from the containing folder and `.gitconfig`.
# Refinements welcome.
# Gather constant vars
CURRENTDIR=${PWD##*/}
GITHUBUSER=$(git config github.user)
@robwierzbowski
robwierzbowski / switch_to_npm_registry.sh
Last active Dec 3, 2020
Configure yarn to use the npm registry directly
View switch_to_npm_registry.sh
#!/bin/bash
# Remove all settings in the .npmrc except the required auth token setting.
echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' > .npmrc
# Create a new .yarnrc that specifies the npm registry, or append to an existing one.
echo 'registry: https://registry.npmjs.org/' >> .yarnrc
# Remove and regenerate the yarn.lock. This should be identical to running `yarn upgrade`.
# If you are uncomfortable regenerating the yarn.lock file, you can comment out the next
@robwierzbowski
robwierzbowski / contributing.md
Last active Jan 24, 2018
Simple rules for contributing to GitHub repositories. Edits encouraged.
View contributing.md

Hi! Thanks for using this project. I had a lot of fun building it, and I hope you're having fun using it too.

If you have an error or support request

  • Read the error message and documentation.
  • Search existing issues, closed issues, and the internet first.
  • If the issue is with a dependency of this project, post on the dependency's repo.
  • If you can fix the issue, submit a PR 👍 💃 💃 🚀.
  • If the issue persists, post on the issue tracker. Include any information that could help others reproduce and fix.
@robwierzbowski
robwierzbowski / index.js
Last active Nov 15, 2017
No `sort()` anagram tester
View index.js
// Takes two strings.
// Returns true if they're anagrams, false if not.
function isAnagram (a, b) {
const remove = (string, pattern) => string.replace(new RegExp(pattern, 'ig'), '');
// Discard whitespace; anagrams can be different numbers of words
let lettersA = remove(a, '\\s');
let lettersB = remove(b, '\\s');
@robwierzbowski
robwierzbowski / mixins.scss
Last active Nov 2, 2017
PostCSS mixin example
View mixins.scss
/* type.css */
@import 'vars.css';
@define-mixin header {
font-family: $font-sans;
font-weight: 600;
letter-spacing: -0.01em;
}
@robwierzbowski
robwierzbowski / additive.scss
Last active Nov 2, 2017
Example of additive styles
View additive.scss
.userPreview {
border: solid $off-black;
&.--default {
border-width: 5px;
font-size: 1.5rem;
background: $light-gray;
}
&.--compact {
@robwierzbowski
robwierzbowski / non-additive.scss
Last active Nov 2, 2017
Example of non-additive styes
View non-additive.scss
.userPreview {
border: 5px solid $off-black;
font-size: 1.5rem;
background: $light-gray;
&.--compact {
border: 1px solid $off-black;
font-size: 1rem;
background: transparent;
}
@robwierzbowski
robwierzbowski / set.css
Last active Nov 2, 2017
Set stylesheet example. Uses PostCSS nesting and simple variables.
View set.css
/*
Set default element styles
Based partially on sanitize.css v2.0.0
github.com/jonathantneal/sanitize.css
*/
*,
::before,
::after {
box-sizing: border-box;
@robwierzbowski
robwierzbowski / reset.css
Last active Nov 2, 2017
Reset stylesheet example. Uses PostCSS nesting.
View reset.css
/*
Reset text elements for easy semantic use.
http://anthonyshort.me/global-typographic-styles-suck/
*/
/* Pseudo */
:focus {
outline: none;
}
@robwierzbowski
robwierzbowski / UserSummary.html
Last active Nov 2, 2017
UserSummary template example
View UserSummary.html
<article styleName="userSummary --compact">
<img styleName="image -loading" src="/low-res.jpg" />
<div styleName="firstName">Mr. Jim</div>
<div styleName="lastName">Business</div>
</article>