Skip to content

Instantly share code, notes, and snippets.

@sadikaya
sadikaya / npm-global-check.md
Created November 11, 2016 12:24
check globally installed npm packages
npm list -g --depth=0
$ npm list -g --depth=0
C:\Users\skay\AppData\Roaming\npm
+-- colorguard@1.2.0
+-- create-react-app@0.6.0
+-- node-gyp@3.4.0
@sadikaya
sadikaya / package.json
Last active November 18, 2016 13:31
use npm-scripts to deploy build folder to gh-pages.
{
"scripts": {
"deploy": "git push origin :gh-pages && git subtree push --prefix [build-folder] origin gh-pages"
}
}
@sadikaya
sadikaya / git-mirror.md
Created November 20, 2016 10:47
Mirror git repository, good for backup or migration
git clone --mirror <url_of_old_repo>
cd <name_of_old_repo>
git remote add new-origin <url_of_new_repo>
git push new-origin --mirror
@sadikaya
sadikaya / git-bash-in-webstorm.md
Last active November 26, 2024 15:31
git bash inside Webstorm terminal

Go to File -> Settings -> Tools -> Terminal and change Shell path based on the the installed git version.

for 64bit:

"C:\Program Files\Git\bin\sh.exe" --login -i

for 32bit:

"C:\Program Files (x86)\Git\bin\sh.exe" --login -i
@sadikaya
sadikaya / cmder-in-webstorm.md
Created November 28, 2016 06:52
Cmder inside Webstorm terminal
  1. Set an environment variable called CMDER_ROOT to your root Cmder folder (in my case C:\Program Files (x86)\Cmder). It seems to be important that this does not have quotes around it because they mess with concatenation in the init script.
  2. In your IntelliJ terminal settings, use "cmd" /k ""%CMDER_ROOT%\vendor\init.bat"" as the Shell path. The double-double-quotes are intentional, as they counteract the missing double quotes in the environment variable.
@sadikaya
sadikaya / react-lifecycles.md
Created December 15, 2016 06:03
react component lifecycles

React Component Lifecycle

  • getInitialState
  • getDefaultProps
  • componentWillMount
  • componentDidMount
  • shouldComponentUpdate (Update only)
  • componentWillUpdate (Update only)
  • componentWillReceiveProps (Update only)
  • render
  • componentDidUpdate (Update only)
@sadikaya
sadikaya / rename-git-branch-local-remote.sh
Created June 12, 2017 11:16
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
@sadikaya
sadikaya / README.md
Created September 12, 2017 11:18 — forked from christianc1/README.md
SFTP Deploys for Pressed with Circle CI

Simple SFTP Deploy when better methods are unavailable by host

Installation

  • npm install --save-dev ftps
  • Add deploy.js to theme/plugin root
  • Add deploy.config.js to theme/plugin root
  • Modify config.

Usage

  • Set up Circle CI with SFTP_HOST SFTP_PASS SFTP_USER environmental variables
@sadikaya
sadikaya / Howto convert a PFX to a seperate .key & .crt file
Created November 27, 2017 07:56 — forked from TemporaryJam/Howto convert a PFX to a seperate .key & .crt file
How to convert a .pfx SSL certificate to .crt/key (pem) formats. Useful for NGINX
source: http://www.markbrilman.nl/2011/08/howto-convert-a-pfx-to-a-seperate-key-crt-file/
`openssl pkcs12 -in [yourfile.pfx] -nocerts -out [keyfile-encrypted.key]`
What this command does is extract the private key from the .pfx file. Once entered you need to type in the importpassword of the .pfx file. This is the password that you used to protect your keypair when you created your .pfx file. If you cannot remember it anymore you can just throw your .pfx file away, cause you won’t be able to import it again, anywhere!. Once you entered the import password OpenSSL requests you to type in another password, twice!. This new password will protect your .key file.
Now let’s extract the certificate:
`openssl pkcs12 -in [yourfile.pfx] -clcerts -nokeys -out [certificate.crt]`
@sadikaya
sadikaya / convert_pfx_to_pem_key.md
Created November 27, 2017 08:56
Converting a PFX file to PEM and Key via openssl

Export the private key

openssl pkcs12 -in certificate.pfx -out certificate.key -nocerts -nodes

Take out the encryption from the private key

openssl rsa -in certificate.key -out certificate_new.key