Skip to content

Instantly share code, notes, and snippets.

View marcelosantos's full-sized avatar

Marcelo Santos marcelosantos

View GitHub Profile

Complete List of Toolbar Items for CKEditor 4

items

"Source"

"Save"

"NewPage"

Show Process Information

ps -ax

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}

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 */
});

Heroku and Let's Encrypt Certs

Install certbot

brew install certbot

Generate Certs manualy

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

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
@marcelosantos
marcelosantos / Splash-screen-time.md
Last active May 5, 2017 16:05
Tip for ionic splash screen time

This is a workaround for issue with the white screen:

In config.xml file I have set:

preference name="SplashScreenDelay" value="20000"
preference name="SplashShowOnlyFirstTime" value="false" 
preference name="AutoHideSplashScreen" value="false"