How to use meteors own non-core packages when running from a git checkout - meteor

When running meteor from a git checkout, there are 2 packages available at path
<meteor-path>/packages/non-core
npm-bcrypt/
npm-node-aes-gcm/
How to use/enable these packages (best practise) on own project?

You can use the published versions of your packages already, because they're on Atmosphere:
meteor add npm-bcrypt
If you want to use specifically their git checkout versions, you need to create a packages subdirectory in your app's directory, and symlink there the paths to the packages.

Much easier than symlink is just setting the PACKAGE_DIRS env var. Have a look at https://forums.meteor.com/t/missing-non-core-packages-when-running-meteor-from-checkout/1140 for more details.

Related

How to completely remove renv from an R statistics program

I have been using renv on a R project, but now want to remove it from renv versioning, i.e. delete all renv associated files, but still have access to the libraries that I used installed under renv. How do I do this? Alternatively, how do I migrate from renv to packrat?
From RStudio's documentation, link provided by Kevin:
To deactivate renv in a project, use renv::deactivate(). This removes the renv auto-loader from the project .Rprofile, but doesn’t touch any other renv files used in the project. If you’d like to later re-activate renv, you can do so with renv::activate().
To remove renv from a project, use renv::deactivate() to first remove the renv auto-loader from the project .Rprofile, then delete the project’s renv folder and renv.lock lockfile as desired.
If you want to completely remove any installed renv infrastructure components from your entire system, you can do so with the following R code:
root <- renv::paths$root()
unlink(root, recursive = TRUE)
The renv package can then also be uninstalled via:
utils::remove.packages("renv")
Note that if you’ve customized any of renv’s infrastructure paths as described in ?renv::paths, then you’ll need to find and remove those customized folders as well.
Have you tried renv::isolate? That should bring over all the libraries from the renv shared cache into the local project directory? But perhaps that's not what you want to do?

ignore dev dependencies in php composer

I have developed a composer laravel based project that I need to install on a remote production server. The problem is I have limited permission/ access so my option is to "archive" the package( using composer archive) and unpack on the production.
What folders do I need to archive and how can I ignore the dev dependencies of the package as well as vendor dev dependencies?
composer archive is likely not to help you, because this command creates an archive of a defined version of a package.
You probably want to upload the whole working application, and not only one package. You should create a little script that will create the archive file for you, which should do:
checkout the application from the repository in a new directory
run composer install --no-dev to install all required dependencies without dev-dependencies
optionally delete files that are not necessary on the server, like documentation, the .git folder, and other stuff
create the archive file from all these files
optionally upload that archive to the target server and unarchive there
optionally check basic functions and switch to the new uploaded version on the server

How to re-use an already installed package in Meteor?

I installed couple of packages for 'Project A' (e.g bootstrap) assuming that it will be available for all subsequent projects. But when a new meteor project 'Project B' was created, meteor list showed only default packages. So my assumption that meteor packages are like ruby gems available globally is incorrect. As I work offline every now and then, Is there a way I can manually copy/re-use installed packages?
Yes they are similar to gems. Packages are installed in ~/.meteor/packages, in precompiled form. They can be installed globally this way.
When you add a package to your project it will essentially copy the package from there into your build-cache directory hidden in the .meteor directory of your project.
To install a package locally where you can easily re-use it you would have to clone the github repository of the package and place the output in the /packages directory of your Meteor app.
For example for bootstrap, twbs:bootstrap you would clone this reposistory: https://github.com/twbs/bootstrap, into a directory like /packages/twbs:bootstrap (name doesn't matter if its defined in the package.js file on the repository.
In general you can easily re-use a package without the hassle of adding it in manually like so. It's better to use the global packages which are kept up to date.
The trouble comes with being offline. If you use a local package its nearly guaranteed to always work. Whereas the global ones can give a bit of trouble once in a while when you try to add a package in as meteor tries to check the package is up to date, especially where npm packages are involved with the package.
To keep it short if you added a package in using meteor add twbs:bootstrap you should most likely be able to add it to another project using the same command. Only if you keep your packages & meteor up to date.

RStudio project and git repository in subdirectory

When developing packages in RStudio.
By default RStudio assume your package directory is the project directory and it looks like that:
But you are allowed to point the package location to a subdirectory of the project directory and it looks like that:
This way you can have some part of your project files, kept in the root project directory, not included in the package. You don't need to set git ignore etc.
But if you want to add RStudio git repo features, you are not allowed to point your git repo in subdirectory, even if you have already created git repo in your package dir (not project dir) you cannot set it in RStudio. I'm stuck at:
Is there any way to enable git repo features in RStudio having git repository in the subdirectory of the RStudio project? Maybe some .Rproj config tweaks?
Very good question. I've experienced the same trouble and it also does not go away with the latest pre-test release. So there's likely no super quick solution to this inside rstudio. Though it might be worth a feature request.
Personally I use the console / git bash with git and rstudio. That is I create a project inside R studio and manually run git init outside rstudio. Also I add, commit, merge, push and pull outside rstudio. If you don't like to manage git via console there's https://windows.github.com/ and https://mac.github.com/ also the folks at Atlassian provide some GUI tool called source tree: https://www.atlassian.com/software/sourcetree/overview
Plus there are many others, like Tortoise Git which I haven't tested, but I think R Studio's current git support is fine for simple things, but a git tool (console or gui) is definitely the way to go if you want to be more flexible.
That being said, sublime text edit is a powerful and easy to hack and customizable text editor which also has quite some packages to extend it. It's not entirely free but sometimes it's a nice supplement to rstudio. And it has a cool resolve conflict package etc.

Setting up Git repo with other Git repo with Submodule? (WordPress development)

I have a Git project/repo called "ABC" to which I would like to add WordPress among other things.
ABC
WordPress
Other
Stuff
Ideally I would like to base my WordPress setup on the WordPress Skeleton repo.
(The WordPress Skeleton also contains a submodule referring to the latest stable WordPress release.)
How do I go about creating this setup?
Should I fork the WordPress-skeleton vs copy it into my existing repo?
How do I update the submodule that the WP-skeleton refers to from my ABC git repo?
I guess I am confused regarding the use of forks in this scenario when I want the ABC to contain code from other repos that in themselves have submodules.
Basically what you are looking for is a tool to manage multiple repos. Here are few:
repo (http://source.android.com/source/version-control.html)
gitslave (http://gitslave.sourceforge.net/)
Also beware of submodule gotchas':
http://codingkilledthecat.wordpress.com/2012/04/28/why-your-company-shouldnt-use-git-submodules/
#dani I did something like that. I created this git project: http://stechico.github.io/wordpress-skeleton/
Code samples there if any. HTH

Resources