Skip to content

Instantly share code, notes, and snippets.

View tonysamperi's full-sized avatar

Tony Samperi tonysamperi

View GitHub Profile
@tonysamperi
tonysamperi / ubi-angular-onboarding.md
Last active August 31, 2021 16:51
UBI Angular onboarding

UBI Angular onboarding

Premise

All of the following paths will be relative to the FE_COMPONENT/iwb-migration folder, which you can find from the root of each branch. You'll need to work only in the iwb-migration folder, so you should download that directly, since SVN allows you to.

The Angular project uses Angular 8, don't try ng update, cause it's mostly pointless, risky and won't give you real benefits.

Project structure

@tonysamperi
tonysamperi / ubi-frontend-onboarding.md
Last active August 31, 2021 17:09
UBI frontend onboarding

Environment

Premise

All of the following paths will be relative to the FE_COMPONENT folder, which is in the root of each branch. You'll need to work only in the FE_COMPONENT folder, so you should download that directly, since SVN allows you to.

So when talking about "root" we will refer to FE_COMPONENT

Branch preview

@tonysamperi
tonysamperi / gulpfile-autoprefixer.js
Last active September 18, 2020 18:13 — forked from leymannx/gulpfile.js
Gulp Sass with autoprefixer and minify.
var gulp = require('gulp'),
sass = require('gulp-sass'),
rename = require('gulp-rename'),
cssmin = require('gulp-cssnano'),
prefix = require('gulp-autoprefixer'),
plumber = require('gulp-plumber'),
notify = require('gulp-notify'),
sassLint = require('gulp-sass-lint'),
sourcemaps = require('gulp-sourcemaps');
// Temporary solution until gulp 4
@tonysamperi
tonysamperi / camelToKebab.js
Created May 22, 2020 10:46 — forked from nblackburn/camelToKebab.js
Convert a string from camel case to kebab case.
module.exports = (string) => {
return string.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, '$1-$2').toLowerCase();
};
@tonysamperi
tonysamperi / gh-pages.md
Created May 17, 2019 07:14
Clean gh-pages branch

Creating a clean gh-pages branch

This is the sequence of steps to follow to create a root gh-pages branch. It is based on a question at [SO]

cd /path/to/repo-name
git symbolic-ref HEAD refs/heads/gh-pages
rm .git/index
git clean -fdx
echo "My GitHub Page" > index.html
@tonysamperi
tonysamperi / multiple_ssh_setting.md
Created December 3, 2018 10:11 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@tonysamperi
tonysamperi / custom-event.polyfill.ts
Created October 17, 2018 12:58
new CustomEvent polyfill (new Event) for IE 9, IE10, IE11
/**
* Modern browsers already support new CustomEvent
* Remember to switch to CustomEvent in your application
*/
// If IE
if (typeof w.CustomEvent !== typeof isNaN) {
const customEvent = function (event, params) {
params = params || {bubbles: false, cancelable: false, detail: undefined};
@tonysamperi
tonysamperi / js
Created September 20, 2018 14:44
Javascript sprintf
/**
* Returns a formatted string using the first argument as a printf-like format.
*
* The first argument is a string that contains zero or more placeholders.
* Each placeholder is replaced with the converted value from its corresponding argument.
*
* Supported placeholders are:
*
* %s - String.
* %d - Number (both integer and float).
@tonysamperi
tonysamperi / prefs.json
Created July 18, 2018 14:27
Visual Studio Code common prefs
{
"telemetry.enableCrashReporter": false,
"telemetry.enableTelemetry": false,
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"**/node_modules": true