Skip to content

Instantly share code, notes, and snippets.

View marcelosantos's full-sized avatar

Marcelo Santos marcelosantos

View GitHub Profile

Are you needs igonre permissions change on your project files ?

So, run the below command to ignore permissions change on GIT

git config core.fileMode false

Do you need know the coordinate system used in your geometry values stored in a postgis database?

Run the below command to get the SRID

SELECT Find_SRID('SCHEME_NAME', 'TABLE_NAME', 'COLLUM_NAME') as srid

Heroku and Let's Encrypt Certs

Install certbot

brew install certbot

Generate Certs manualy

NodeJS and Express Redirect Http To Https

/* Redirect http to https */
app.get('*', function(req,res,next) {
  if(req.headers['x-forwarded-proto'] != 'https' && process.env.NODE_ENV === 'production')
    res.redirect('https://'+req.hostname+req.url)
  else
    next() /* Continue to other routes if we're not redirecting */
});

Option 1: Change the permission to npm's default directory

1 - Find the path to npm's directory:

$ npm config get prefix

2 - Change the owner of npm's directories to the name of the current user (your username!):

$ sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,share}

Show Process Information

ps -ax

Complete List of Toolbar Items for CKEditor 4

items

"Source"

"Save"

"NewPage"

@marcelosantos
marcelosantos / git-remove-all-files-from-repo.sh
Created January 16, 2017 13:00
git: recursively remove all files from a repo
Recursively remove all files of filetype .foo from the repo:
git filter-branch --tree-filter 'git rm -r -f --ignore-unmatch *.foo' HEAD