Skip to content

Instantly share code, notes, and snippets.

@fernandohu
fernandohu / Reading configuration files before application startup in Angular2 final release.md
Last active Jul 24, 2021
Reading configuration files before application startup in Angular2 final release
View Reading configuration files before application startup in Angular2 final release.md

Reading data before application startup in Angular 2

In this demonstration I will show you how to read data in Angular2 final release before application startup. You can use it to read configuration files like you do in other languages like Java, Python, Ruby, Php.

This is how the demonstration will load data:

a) It will read an env file named 'env.json'. This file indicates what is the current working environment. Options are: 'production' and 'development';

b) It will read a config JSON file based on what is found in env file. If env is "production", the file is 'config.production.json'. If env is "development", the file is 'config.development.json'.

@jimmidyson
jimmidyson / 0_download_openshift.sh
Last active Aug 29, 2015
OpenShift Fabric8 start scripts
View 0_download_openshift.sh
#!/bin/bash
curl -L https://github.com/openshift/origin/releases/download/v0.5.1/openshift-origin-v0.5.1-ce1e6c4-linux-amd64.tar.gz | tar xzv
View add-user-from-github.sh
#!/bin/bash
for user in "$@"
do
echo "Adding ${user}"
useradd -m ${user}
mkdir /home/${user}/.ssh
curl https://github.com/${user}.keys >> /home/${user}/.ssh/authorized_keys
chmod 700 /home/${user}/.ssh
chmod 600 /home/${user}/.ssh/authorized_keys
View keybase.md

Keybase proof

I hereby claim:

  • I am jimmidyson on github.
  • I am jimmidyson (https://keybase.io/jimmidyson) on keybase.
  • I have a public key whose fingerprint is 5E87 7349 6DCB FB12 0E38 4322 2863 494B 281B E805

To claim this, I am signing this object:

@ackyshake
ackyshake / .zshrc
Created Dec 27, 2014
Useful vi keybindings for zsh's vi-mode.
View .zshrc
bindkey -v
bindkey -M vicmd "?" history-incremental-pattern-search-backward
bindkey -M vicmd "/" history-incremental-pattern-search-forward
bindkey -M vicmd v edit-command-line
bindkey -M vicmd 'u' undo
bindkey -M vicmd '^r' redo
bindkey -M vicmd '~' vi-swap-case
bindkey '^[[A' history-substring-search-up
bindkey '^[[B' history-substring-search-down
bindkey '^[[Z' reverse-menu-complete