Skip to content

Instantly share code, notes, and snippets.

@muhannad0
muhannad0 / hugo.gitignore
Last active May 12, 2020 07:03
Sample gitignore for Hugo projects
### Hugo ###
# Generated files by hugo
/public/
/resources/_gen/
# Executable may be added to repository
hugo.exe
hugo.darwin
hugo.linux

npm shrinkwrap is useful, but maddening (once it's in place and you want to update a package).

Say you've got a package.json with module ember-cli as a devDependency currently at version 1.13.1. And you have an npm-shrinkwrap.json file too, generated with the --dev flag.

If you change the version of ember-cli to, say, 1.13.8 in package.json and run npm install, nothing will happen.

If you do that and manually change references in the shrinkwrap file, you will still have trouble (as nested dependencies may now be incorrect).

So what do we actually do?

Git Cheat Sheet

Commands

Getting Started

git init

or

call plug#begin('~/.vim/plugged')
Plug 'kchmck/vim-coffee-script'
Plug 'kien/ctrlp.vim'
Plug 'rking/ag.vim'
Plug 'scrooloose/nerdcommenter'
Plug 'scrooloose/nerdtree'
Plug 'slim-template/vim-slim'
Plug 'thoughtbot/vim-rspec'
Plug 'tpope/vim-fugitive'
@jkubacki
jkubacki / gist:e2dd904bd648b0bd4554
Created January 21, 2015 18:47
Mac uninstall elasticsearch
#!/usr/bin/env sh
# checks to see if running
launchctl list | grep elasticsearch
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.elasticsearch.plist
launchctl remove homebrew.mxcl.elasticsearch
pkill -f elasticsearch
@paulallies
paulallies / gist:0052fab554b14bbfa3ef
Last active November 12, 2023 23:00
Remove node_modules from git repo
#add 'node_modules' to .gitignore file
git rm -r --cached node_modules
git commit -m 'Remove the now ignored directory node_modules'
git push origin <branch-name>
@DanHerbert
DanHerbert / fix-homebrew-npm.md
Last active February 12, 2024 17:18
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

OBSOLETE

This entire guide is based on an old version of Homebrew/Node and no longer applies. It was only ever intended to fix a specific error message which has since been fixed. I've kept it here for historical purposes, but it should no longer be used. Homebrew maintainers have fixed things and the options mentioned don't exist and won't work.

I still believe it is better to manually install npm separately since having a generic package manager maintain another package manager is a bad idea, but the instructions below don't explain how to do that.

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

@tomas-stefano
tomas-stefano / Capybara.md
Last active May 2, 2024 05:16
Capybara cheatsheet

Capybara Actions

# Anchor
click_link 'Save'

# Button
click_button 'awesome'

# Both above
@joshuapekera
joshuapekera / Gitflow.md
Created June 12, 2013 08:49
Gitflow Terminal Commands

git-flow

Initialization

To initialize a new repo with the basic branch structure, use:

git flow init [-d]

This will then interactively prompt you with some questions on which branches you would like to use as development and production branches, and how you

@adamloving
adamloving / rails-flash-partial.slim
Created February 19, 2013 19:32
Applies Twitter bootstrap styles to rails flash messages. Add this to your application layout with = render 'layouts/flash', :locals => { :flash => flash } To quote http://stackoverflow.com/questions/5798791/what-is-the-difference-when-using-flash-error-alert-and-notice "The semantics of what or when to use :alert/:error/:notice are really up to…
- if locals[:flash]
- flash = locals[:flash]
- if flash[:warn] || flash[:alert]
.alert #{flash[:warn]} #{flash[:alert]}
- if flash[:notice] || flash[:success]
.alert.alert-success #{flash[:notice]} #{flash[:success]}
- if flash[:info]
.alert.alert-info #{flash[:info]}
- if flash[:error]
.alert.alert-error #{flash[:error]}