How can Gulp be restarted upon each Gulpfile change?

You can create a task that will gulp.watch for gulpfile.js and simply spawn another gulp child_process. var gulp = require(‘gulp’), argv = require(‘yargs’).argv, // for args parsing spawn = require(‘child_process’).spawn; gulp.task(‘log’, function() { console.log(‘CSSs has been changed’); }); gulp.task(‘watching-task’, function() { gulp.watch(‘*.css’, [‘log’]); }); gulp.task(‘auto-reload’, function() { var p; gulp.watch(‘gulpfile.js’, spawnChildren); spawnChildren(); function spawnChildren(e) { … Read more

Importing modules in Python – best practice

Disadvantage of each form When reading other people’s code (and those people use very different importing styles), I noticed the following problems with each of the styles: import modulewithaverylongname will clutter the code further down with the long module name (e.g. concurrent.futures or django.contrib.auth.backends) and decrease readability in those places. from module import * gives … Read more

How can I get my C code to automatically print out its Git version hash?

If you are using a make-based build, you can put this in the Makefile: GIT_VERSION := “$(shell git describe –abbrev=4 –dirty –always –tags)” (See man git describe for what the switches do) then add this to your CFLAGS: -DVERSION=\”$(GIT_VERSION)\” Then you can just reference the version directly in the program as though it was a … Read more

“git pull” or “git merge” between master and development branches

This workflow works best for me: git checkout -b develop …make some changes… …notice master has been updated… …commit changes to develop… git checkout master git pull …bring those changes back into develop… git checkout develop git rebase master …make some more changes… …commit them to develop… …merge them into master… git checkout master git … Read more

Git: Set up a fetch-only remote?

I don’t think you can remove the push URL, you can only override it to be something other than the pull URL. So I think the closest you’ll get is something like this: $ git remote set-url –push origin no-pushing $ git push fatal: ‘no-pushing’ does not appear to be a git repository fatal: The … Read more

Proper way to create dynamic workflows in Airflow

Here is how I did it with a similar request without any subdags: First create a method that returns whatever values you want def values_function(): return values Next create method that will generate the jobs dynamically: def group(number, **kwargs): #load the values if needed in the command you plan to execute dyn_value = “{{ task_instance.xcom_pull(task_ids=”push_func”) … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)