Two identical CSS files, one modified, replace only the altered styles, is that possible? - css

I have two files where I edited one and left the other just for reference.
However I screwed some codes on the file I'm editing and since its a huge file, I don't know where I made the error or even if it have more errors. It was not altered I just deleted it.
I want to know if there is a program, plugin, script, something that I can insert the two files and override only the parameters of the classes that was edited (the class names wasn't altered).
I know I should have used GIT and all but I didn't. Lesson learned.
Appreciate any help. I'm using SublimeText.

If you're on a Unix-like OS, or you have Cygwyn installed you can use diff and patch to do this.
$ diff -u old.css new.css > changes.diff
$ patch < changes.diff

Related

Can a 'linked'-file be renamed programatically via an Extension

I've written an Extension that, among many other things, renames files based on the Types they contain.
This works fine for files in the directory-tree under the csproj-file -- I find the ProjectItem entry for the file and change its name.
For 'linked'-files (those not in the directory-tree) I can rename the file (via File.Move()) but haven't found a way to programatically modify the csproj-file (after the rename the csproj-file has to be modified manually).
If this is something that can be done I'd appreciate a pointer to the docs showing how to implement the functionality.
The easiest solution for me was to modify the csproj-file.
Open, read whole file, close.
Verify that file I want to rename (e.g. xxx.cs) only occurs in 1 directory
(if it occurs in multiple directories the change has to be done manually.)
Make change
Open, write whole file, close
For an SDK project the change is applied immediately.
For a non-SDK project the change is applied after responding to the prompt that the csproj-file has been modified.

ATOM - CSSLINT ignore ids

Is there a way to make csslint in Atom ignore "ids", so I don't get the warning "Don't use IDs in selectors"?
Edit: My question was identified as a possible duplicate of "Disable warnings (ids selector) in linter-csslint on Atom?", but I mentioned in my own answer that I could not understand how to make the process to solve my problem. I ended up finding out.
Well, guys, I ended up discovering how to do that. The other questions similar to mine did solve the problem, but they were not so clear TO ME on how to make the solution work. If you guys go to github "https://github.com/ebednarz/csslintrc/blob/master/.csslintrc", there are some lines to ignore the elements. What wasn't that clear to me was "ok, what should I do with it?".
So you have two options (I use Windows). You either create a file in Atom or command line called ".csslintrc" and place it INSIDE THE FOLDER OF THE PROJECT you are working on OR you can place this file in your USER FOLDER IN WINDOWS. Like, "C:\Users\yourUserName". If you put it there, all the projects will use this file.

Ada `Gprbuild` Shorter File Names, Organized into Directories

Over the past few weeks I have been getting into Ada, for various different reasons. But there is no doubt that information regarding my personal reasons as to why I'm using Ada is out of scope for this question.
As of the other day I started using the gprbuild command that comes with the Windows version of GNAT, in order to get the benefits of a system for managing my applications in a project-related manner. That is, being able to define certain attributes on a per-project basis, rather than manually setting up the compile-phase myself.
Currently when naming my files, their names are based off of what seems to be a standard for the grpbuild, although I could very much be wrong. For periods (in the package structure), a - is put in the name of the file, for underscores, an _ is put accordingly. As such, a package by the name App.Test.File_Utils would have a file name of app-test-file_utils: .ads and .adb accordingly.
In the .gpr project file I have specified:
for Source_Dirs use ("app/src/**");
so that I am allowed to use multiple directories for storing my files, rather than needing to have them all in the same directory.
The Problem
The problem that arises, however, is that file names tend to get very long. As I am already putting the files in a directory based on the package name contained by the file, I was wondering if there is a way to somehow make the compiler understand that the package name can be retrieved from the file's directory name.
That is, rather than having to name the App.Test.File_Utils' file name app-test-file_utils, I would like it to reside under the app/test directory by the name file_utils.
Is this doable, or will I be stuck with the horrors of eventually having to name my files along the lines of: app-test-some-then-one-has-more_files-another_package-knew-test-more-important_package.ads? Granted, I have not missed something about how an Ada application should actually be structured.
What I have tried
I tried looking for answers in the package Naming configuration of the gpr files in the documentation, but to no avail. Furthermore I have been browsing the web for information, but decided it might be better to get help through Stackoverflow, so that other people who might struggle with this problem in the future (granted it is a problem in the first place) might also get help.
Any pointers in the right direction would be very helpful!
In the top-secret GNAT documentation there is a description of how to use non-default file names. It's a great deal of effort. You will probably give up, use the default names, and put them all in a single directory.
You can also simplify much of the effort by using GPS and letting it build your project file as you add files to your source directories.

Change Working Directory (pwd) to Script Location in Stata 12

I have a lot of scripts (.do files) in different folders, which are frequently moved around. I would like to have Stata detect where the script is, and use that as a pwd (working directory). I know people that have this functionality seemingly by default (the pwd is changed to the script location when the script is run), but we cannot figure out why I am not so lucky. It is a bit tedious always having a "cd" line at the top of my scripts, and having to change this line to reflect the current directory. I'm using Stata 12 with Windows 7 Professional.
It looks to me like something similar is answered in this question:
Paths to do-file in Stata
What it seems like you could do is keep an MS Excel file that somehow tracks the location of all your scripts, and then use that to generate a simple high-level do-file that calls all your programs (although this may not be how your scripts work). If your folder locations are changing I am not sure how you can completely avoid updating at least some lines of code when something gets moved around. This would at least centralize the necessary updates into one place.
You can use Sublime text.
https://sublime.wbond.net/packages/Stata%20Enhanced
When you build the do file (or a selection) using sublime text, the filepath of the do file automatically becomes the current directory.

UNIX - Renaming files with long names

I am screwed. I misused wildcards like a moron, in the rename command.
I repeated names twice in a 3gig folder, which I cannot afford to delete.
Now, the rename command is not working, and it says the file name is too long.
Please help me.
If programming can solve this, please let me know. I am a competent programmer in Java and PHP.
Under the hood, any rename command should get implemented with rename(). If you are in the directory where the file is and do:
mv hugefilenamethatiscreweduponandwanttobemuchshorted tersefile
it should work, as I don't think the path would get expanded out and overflow the limit. Otherwise, you can temporarily move the parent directory somewhere so it had a minimal path (like /p) and then rename the file and then move it back.

Resources