Skip to content

Instantly share code, notes, and snippets.

@nickdyar
nickdyar / macro__ClearFormat
Created September 7, 2021 15:08
Reset font and paragraph formatting, and remove numbering/bulleting.
Sub ClearFormat()
'
' Microsoft Word Macro
' ClearFormat = reset font + paragraph formatting, and remove numbering/bullets
'
'
Selection.Style = ActiveDocument.Styles("Normal")
Selection.Range.ListFormat.RemoveNumbers NumberType:=wdNumberParagraph
With Selection.Font
.Name = "Arial"
@nickdyar
nickdyar / smashing-template.md
Created December 20, 2020 14:18 — forked from rachelandrew/smashing-template.md
Template for Smashing Magazine authors

Authors Guide: Article Template

Please submit your article including all of the information below. You can include this as a seperate file if you like - but please complete each section. Please use an online service to write your article, for example Dropbox Paper, Draft.in, Google Docs. For more help, see the editorial guide

Article Title

Ideally under 67 characters, what problem does this article solve?

Quick Summary

^.*?<([a-z]+*)\s?(class=")?(css-|__.*">)?(([a-z0-9]){6}">)?(</)?.*>?
@nickdyar
nickdyar / import_csv_to_mongo
Created July 9, 2020 03:38 — forked from mprajwala/import_csv_to_mongo
Store CSV data into mongodb using python pandas
#!/usr/bin/env python
import sys
import pandas as pd
import pymongo
import json
def import_content(filepath):
mng_client = pymongo.MongoClient('localhost', 27017)
@nickdyar
nickdyar / .eslintrc.js
Created June 29, 2020 09:02 — forked from nkbt/.eslintrc.js
Strict ESLint config for React, ES6 (based on Airbnb Code style)
{
"env": {
"browser": true,
"node": true,
"es6": true
},
"plugins": ["react"],
"ecmaFeatures": {
@nickdyar
nickdyar / using-eslint-with-prettier.md
Created June 29, 2020 07:36 — forked from yangshun/using-eslint-with-prettier.md
Comparison between tools that allow you to use ESLint and Prettier together.
prettier-eslint eslint-plugin-prettier eslint-config-prettier
What it is A JavaScript module exporting a single function. An ESLint plugin. An ESLint configuration.
What it does Runs the code (string) through prettier then eslint --fix. The output is also a string. Plugins usually contain implementations for additional rules that ESLint will check for. This plugin uses Prettier under the hood and will raise ESLint errors when your code differs from Prettier's expected output. This config turns off formatting-related rules that might conflict with Prettier, allowing you to use Prettier with other ESLint configs like eslint-config-airbnb.
How to use it Either calling the function in your code or via [prettier-eslint-cli](https://github.co
@nickdyar
nickdyar / osx_setup.md
Created June 29, 2020 07:36 — forked from millermedeiros/osx_setup.md
Mac OS X setup

Setup Mac OS X

I've done the same process every couple years since 2013 (Mountain Lion, Mavericks, High Sierra, Catalina) and I updated the Gist each time I've done it.

I kinda regret for not using something like Boxen (or anything similar) to automate the process, but TBH I only actually needed to these steps once every couple years...

@nickdyar
nickdyar / .gitconfig
Created June 29, 2020 07:36 — forked from pksunkara/config
Sample of git config file (Example .gitconfig)
[user]
name = Pavan Kumar Sunkara
email = [email protected]
username = pksunkara
[core]
editor = vim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
excludesfile = ~/.gitignore
[sendemail]
smtpencryption = tls
" Specify a directory for plugins
call plug#begin('~/.vim/plugged')
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'scrooloose/nerdtree'
"Plug 'tsony-tsonev/nerdtree-git-plugin'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
Plug 'ryanoasis/vim-devicons'
Plug 'airblade/vim-gitgutter'
@nickdyar
nickdyar / gitcheats.txt
Created June 29, 2020 07:32 — forked from chrismccoy/gitcheats.txt
git cheats
# shortform git commands
alias g='git'
# pretty tab'd git log
git log --graph --pretty="tformat:%h*(%ar)*<%an>*%d %s" $* | sed -Ee 's/(^[^<]*) ago\)/\1)/' | sed -Ee 's/(^[^<]*), [[:digit:]]+ .*months?\)/\1)/' | column -s '*' -t | cat
# change author of all git repos
git filter-branch -f --env-filter "GIT_AUTHOR_NAME='yourname'; GIT_AUTHOR_EMAIL='[email protected]'; GIT_COMMITTER_NAME='yourname'; GIT_COMMITTER_EMAIL='[email protected]';" HEAD;
# stage only deleted files