Atom Snippets : Snippets in Local Directory - atom-editor

Hi New atom editor user here (SO AMAZING)
I have been spending an hour or so getting my snippets to work in a local folder
My snippets work when I place my snippets in the ~/.atom
But I was wondering if I could get it to work in a local directory with following structure below :
example_1/
├── test.py
├── snippets
   └── snippets.cson
This is how my snippet look like :
'.source.python':
'Console log':
'prefix': 'log'
'body': 'CATFORSALES'
I tried looking at the discussion board but still can't find any relevant. Either it is something really obvious that no one mentioned or im really blind (either way do let me know, I can get either my head checked or my eyes checked =))
Thanks in advance!
Cheers

Snippets are loaded from:
~/.atom/snippets.cson
./snippets/*.cson in an Atom package
So your choices for how to load snippets from a file other than #1 are to:
Symlink your snippets file to ~/.atom/snippets.cson
Create an Atom package for your snippets

Related

File download in Voila from Jupyter Notebook

There are many questions with great answers about downloading a file from a Jupyter Notebook. Here's one I added to earlier. That works, but I am unable to click and download that file for a server started with Voila.
Originally I realized I could not download the basic case when clicked through Voila.
from IPython.display import display, FileLink
local_file = FileLink('./demo.xlsx', result_html_prefix="Click here to download: ")
display(local_file)
That is from my notebook. I am able to click on the link and download the file. When I start my notebook with Voila it looks more like this..
Clicking the link give a 404 ☝️ for a voila server started with
voila mynotebook.ipynb
Since the file clearly isn't being served... I found this link here and tried:
voila mynotebook.ipynb --VoilaConfiguration.file_whitelist="['demo.xlsx']"
which unfortunately didn't work.
I saw static content can be served in voila.. I'll keep playing down this road. Has anyone done this before?
I was able to make it work by hosting my file to download as static content as I was trying before. All of this is for a Mac, but it'll be similar for other platforms.
I had to define a custom template in order to get files at static_root so they could be served. Relevant documentation is here for setting up a custom template.
It isn't difficult.. you essentially create a directory where it's expected, copy over some of the default files, then add/change what you will. terminal record might look something like this:
cd ~/Library/Jupyter/voila/templates/
mkdir foobar
export DEFAULT_TEMPLATE_PATH=~/anaconda3/envs/voilatest/share/jupyter/voila/templates/default
export TEMPLATE_PATH=~/Library/Jupyter/voila/templates/foobar
cp -r $DEFAULT_TEMPLATE_PATH/nbconvert_templates $TEMPLATE_PATH
cp -r $DEFAULT_TEMPLATE_PATH/templates $TEMPLATE_PATH
to which the tree will look like this in my new custom template:
{~/Library/Jupyter/voila/templates/foobar}$ tree .
.
├── nbconvert_templates
│   ├── base.tpl
│   ├── lab.tpl
│   └── voila.tpl
├── static
│   └── demo.xlsx
└── templates
├── 404.html
├── browser-open.html
├── error.html
├── page.html
└── tree.html
3 directories, 9 files
notice the static directory with demo.xlsx. I added that in. That is the file I wanted to download via the link.
Starting voila like this...
voila mynotebook.ipynb --template=foobar
Now.. in mynotebook.ipynb
Use an HTML Anchor tag to do the download. At least FileLink fails for me with the following error.
Path (/voila/static/demo.xlsx) doesn't exist. It may still be in the process of being generated, or you may have the incorrect path.
which isn't much of a surprise since the actual path the file is stored at isn't that. It just happens to be the static content uri.
%%html
Download Excel Sheet
Using an anchor will make it hardcoded and I didn't have any issues. I'll also be able to style the anchor more anyways. One catch.. This doesn't work in a regular notebook anymore since it's a URI to a served resource under voila.

ggplot() graphical output link broken ./static/post/

I've followed the advice at https://bookdown.org/yihui/blogdown/static-files.html by adding a .r file with blogdown::build_dir('static') - and by creating a ./static/post directory - what am I missing?
I also searched through rbind.io blogdown structures, but cannot figure out how to connect rendered graphic outputs to static/post/post-date; not how to automatically redirect outputs to that folder instead of public.
Thanks for the help.
I think I found the problem
The .gitignore file in your static directory prevents git to stage images generated by blogdown, delete it.

Magento2: After delete pub/static folder and making deploy, no css files found

I searched the web, but found no answer that would work:
I use Magento 2 custom theme and when I made changes to .less file, I wanted to compile files, so I deleted pub/static folder and made deploy: php bin/magento setup:static-content:deploy.
After that, no css files are found in pub/static/frontend/<Theme>/default/css.
Also, when I use grunt less, I got errors:
>> Destination pub/static/frontend/Magento/blank/en_US/css/styles-m.css not written because no source files were found.
>> Destination pub/static/frontend/Magento/blank/en_US/css/styles-l.css not written because no source files were found.
>> Destination pub/static/frontend/Magento/blank/en_US/css/email.css not written because no source files were found.
>> Destination pub/static/frontend/Magento/blank/en_US/css/email-inline.css not written because no source files were found.
I am in a developer mode.
Does anyone have any solution for this?
Thank you
I had the same issue, when I did grunt refresh I got the same errors.
To resolve this I removed var/di, var/cache, var/generation, var/page_cache and the contents of pub/static folder (be careful not to remove pub/static/.htaccess).
Then I tried: grunt exec:themename
If successful do, grunt clean
If successful do, grunt refresh
And then, setup:static-content:deploy
This worked for me.
You need to retrieve the file .htaccess from the pub/static folder.
I found it here: https://github.com/magento/magento2/blob/develop/pub/static/.htaccess
*Check the version you use of magento

SilverStripe Swipestripe - swipestripe-gallery module error

I've installed Swipestripe module. and added swipestripe-gallery module for product images.
when I did dev/bulid?flush=1 it shows error Class 'Gallery_PageExtension' does not exists
I have seen gallery.yml file in swipestripe-gallery/_config folder, which has
Product:
extensions:
- 'Gallery_PageExtension'
but this class is not there in Product.php file in swipestripe-gallery/code folder.
After commenting above code I did dev/build?flush=1 & there was no error. But in product page the Gallery tab is not added.
Please Help.
You didn't install using composer? Your fault ;) It installs all requirements for you and you can code happy.
See https://github.com/swipestripe/silverstripe-swipestripe-gallery#requirements, you'll need to install https://github.com/frankmullenger/silverstripe-gallery for getting this gallery extension in your codebase.
I strongly encourage you to install ALL modules with composer. It may be a bit hard in the beginning, but in some days your life will be much more comfortable! A good introduction can be found in the ss docs.
Swipestripe's config does not have that code: https://github.com/swipestripe/silverstripe-swipestripe/blob/2.1/_config/swipestripe.yaml
The gallery module for it does: https://github.com/swipestripe/silverstripe-swipestripe-gallery/blob/1.1/_config/gallery.yml
These are two separate modules. If the gallery file is in swipestripe/_config as you say, then it would seem to me that the install didn't happen as it should.
There should be two folders in your installation root
swipestripe/
swipestripe-gallery/
All files relating to each module should be in each (individual) folder. It seems you're missing the swipestripe-gallery folder all together, meaning that the class in fact does not exist (When you get this error, just check that the class exists somewhere in your install. Using grep is the easiest way).

IAR Embedded Workbench cannot find files, Pe1696, even though it is searching for them

I am using IAR Embedded workbench 5.51 for MSP430. I am using C99.
I am trying include code from a third party library. I have copied the directory structure of this third party library exactly within a sub-directory in my main project directory. However, when I try to compile I get a bunch of
Fatal Error[Pe1696]: cannot open source file "ThirdPartyLib/Subdir/file.h"
However in the log IAR shows:
searched: "C:\ ... bla bla bla ... \Source\ThirdPartyLib\Subdir\"
The include statements in each of the source files in this library are all like:
#include "ThirdPartyLib/Subdir/someheader.h"
I have attempted to add the path to the C preprocessor by going to:
Project -> Options -> C/C++ Compiler -> Preprocessor
and adding the lines:
$PROJ_DIR$\ThirdPartyLib\
$PROJ_DIR$\ThirdPartyLib\Subdir\
$PROJ_DIR$\ThirdPartyLib\Utils\
I do not have "Multi-file Compilation" checked.
All of the source files in question have been added to the project. I have created groups to mimic the directory structure of the library.
The problem goes away if I change the paths from absolute paths to relative paths such as
#include "somelocalheader.h"
#include "../Utils/someotherheader.h"
But I am dealing with a large number of files and want to modify them as little as possible.
I have never had an issue with this before - does anyone have any idea why this would happen. Is there a simple fix for this so I do not have to scrub every include statement in every c file?
This is essentially what my directory tree looks like:
Source
Debug
Exe
Output.d43
List
blabla.map
Obj
...
Release
...
settings
...
ThirdPartyLib
Subdir
... Third Party Code Files Live Here ...
Utils
... More Third Party Code Files Live Here ...
... My Code Lives Here, Along with the EWP, EWW, etc ...
EDIT #2:
I moved the directory of ThirdPartyLib up a level, because I run doxygen recursively on /Source/ and I realized that it takes doxygen FOREVER, and plus the library has its own API.
Anyway, here is what the structure looks like now:
Working Copy
Source
Debug
Exe
Output.d43
List
blabla.map
Obj
...
Release
...
settings
...
... My Code Lives Here, Along with the EWP, EWW, etc ...
ThirdPartyLib
Subdir
... Third Party Code Files Live Here ...
Utils
... More Third Party Code Files Live Here ...
I have added a group back to my project for ThirdPartyLib with two subgroups SubDir and Utils, and added all of the files from the Subdir and Utils directories to the corresponding subgroups.
Now I have tried to compile this again, and again i am faced with the Pe1696 errors. IAR says:
searched: "C:\...\Working Copy\ThirdPartyLib\SubDir"
Yet it is still not finding the files.
I referred to this post:
http://e2e.ti.com/support/low_power_rf/f/155/t/110195.aspx
I am not sure it is completely relevant, because the directories I am including don't seem to have 'fallen out'. IAR is clearly searching for the files.
But I tried anyway to add the following lines to the preprocessor
$PROJ_DIR$\..\ThirdPartyLib\SubDir
$PROJ_DIR$\..\ThirdPartyLib\utils
This does not seem to help. I get these additional lines in the message log:
searched: "C:\...\Working Copy\Source\..\ThirdPartyLib\SubDir\"
searched: "C:\...\Working Copy\Source\..\ThirdPartyLib\Utils\"
Edit #3
I tried moving the EWW/EWP up a level to "Working Copy" and then readded all of the groups and all of the files... no dice. I am lost here. The part that is most frustrating is that the same library is implemented in another project that was done by some former developers and I am trying to include it the same way. I know this is going to be something trivial, I just don't know what.
If all of the #include references inside the library are of the form #include "ThirdPartyLib/Subdir/file.h", then the root directory where ThirdPartyLib is located should be in the preprocessor include path.
If your directory structure is:
C:\My Project\Source
\ThirdPartyLib
then C:\My Project would be expected to be in the preprocessor include path.
When the compiler searches for include files it will join in turn, each of the include search paths with the path listed in the #include directive until a matching file is found.

Resources