Skip to content

Instantly share code, notes, and snippets.

View Ugarz's full-sized avatar

Ugo Ugarz

View GitHub Profile
@Ugarz
Ugarz / removeTracked.md
Last active August 2, 2017 20:41 — forked from Zyber17/gist:8233445
Remove tracked node_modules

Remove tracked files in git

Works with any files / folder, it's delete in remote the target.

git rm -r --cached node_modules
git commit -m 'Remove the now ignored directory node_modules'
git push origin master
@Ugarz
Ugarz / slugify.md
Last active August 2, 2017 09:31 — forked from mathewbyrne/slugify.js
Javascript Slugify

Simple Slugy for strings

function slugify(text) {
  return text.toString().toLowerCase()
    .replace(/\s+/g, '-')           // Replace spaces with -
    .replace(/[^\w\-]+/g, '')       // Remove all non-word chars
    .replace(/\-\-+/g, '-')         // Replace multiple - with single -
    .replace(/^-+/, '')             // Trim - from start of text
 .replace(/-+$/, ''); // Trim - from end of text
@Ugarz
Ugarz / readme.md
Created March 23, 2017 14:48 — forked from coolaj86/how-to-publish-to-npm.md
How to publish packages to NPM

Getting Started with NPM (as a developer)

If you haven't already set your NPM author info, now you should:

npm set init.author.name "Your Name"
npm set init.author.email "you@example.com"
npm set init.author.url "http://yourblog.com"

npm adduser

@Ugarz
Ugarz / gist:fcc74890ada664fde505f00d238fe38a
Last active July 6, 2017 13:09 — forked from lttlrck/gist:9628955
Rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@Ugarz
Ugarz / README.md
Created August 28, 2016 20:20 — forked from christophermanning/README.md
Voronoi Diagram with Force Directed Nodes and Delaunay Links

Created by Christopher Manning

Summary

Nodes are linked to nodes in neighboring cells. The cell's color is a function of its area.

The white lines are the Delaunay triangulation and the purple cells are the Voronoi diagram.

Controls

@Ugarz
Ugarz / remove_node_modules.md
Last active November 19, 2018 09:56 — forked from paulallies/gist:0052fab554b14bbfa3ef
Remove node_modules from git repo

Add 'node_modules' to .gitignore file and remove versionned ones

git rm -r --cached node_modules
git commit -m 'Remove the now ignored directory node_modules'
git push origin master