Skip to content

Instantly share code, notes, and snippets.

View gianlucacandiotti's full-sized avatar

Gianluca Candiotti gianlucacandiotti

  • Wolt
  • Helsinki, Finland
View GitHub Profile
1) Create a branch with the tag
git branch {tagname}-branch {tagname}
git checkout {tagname}-branch
2) Include the fix manually if it's just a change ....
git add .
git ci -m "Fix included"
or cherry-pick the commit, whatever is easier
git cherry-pick {num_commit}
@gianlucacandiotti
gianlucacandiotti / global vars in vue component
Created September 18, 2016 00:42
Using global variables inside vue components with the help of mixins and default props.
// html
window.injectors.baseUrl = '<?= urlHelper('') ?>';
// mixins/injectors.js
const injectorsObj = {};
// eslint-disable-next-line no-undef
Object.keys(window.injectors).forEach((injector) => {
{
"always_show_minimap_viewport": true,
"bold_folder_labels": true,
"caret_style": "phase",
"color_scheme": "Packages/Material Theme/schemes/Material-Theme.tmTheme",
"disable_tab_abbreviations_on_auto_complete": false,
"draw_white_space": "all",
"fade_fold_buttons": false,
"font_face": "Operator Mono Book",
"font_options":
@gianlucacandiotti
gianlucacandiotti / npm - jquery
Created August 18, 2016 16:47
Little example on how to manage jquery from npm
import jquery from 'jquery';
// IIFE
export default (function(testLib){
testLib(jquery, window, document);
}(function($, w, d){
import { round10 } from 'round10';
export function formatMaxDataUnit(quantity, currentUnit = 'Bytes') {
if (quantity < 1024) {
return `${round10(quantity, -2)} ${currentUnit}`;
}
const nextUnit = {
Bytes: 'KB',
KB: 'MB',
shouldComponentUpdate(nextProps, nextState) {
console.log('props')
console.log(this.props);
console.log(nextProps);
console.log(this.props === nextProps);
console.log('state')
console.log(this.state);
console.log(nextState);
(function () {
var _log = console.log;
console.log = function () {
var args = Array.prototype.map.call(arguments, function (arg) {
return typeof arg.toJS === "function" ? arg.toJS() : arg;
});
return _log.apply(console, args);
};
})();
npm i --save babel-plugin-transform-class-properties babel-polyfill babel-preset-es2015 babel-preset-react babel-register babelify browserify dotenv es6-promise forever koa koa-body koa-compress koa-helmet koa-nunjucks-render koa-router koa-static node-fetch node-sass parallelshell ramda react react-dom uglify-js uglifyify whatwg-fetch
npm i --save-dev browser-sync nodemon watchify
sudo kill `sudo lsof -t -i:9001`
@gianlucacandiotti
gianlucacandiotti / fetch remote branch
Created February 8, 2016 17:12
Fetch a remote branch with git
git fetch <remote> <rbranch>:<lbranch>