• Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Archives

Subversion Import

November 2, 2012

Typically, you use the Subversion Import command to start or add a new project to a remote repository. Subversion recommends that you setup three directories called trunk, tags and branches under each project in a repository. Trunk will be the current version you are working on. Tags are for releases. Branches are when you fork projects based on one particular release. The following directory format under each project is recommended.

repository/project/trunk
                  /tags
                  /branches

repository/project/trunk /tags /branches

Once the directories are setup, you can then perform the import command to upload a new project to the repository. Just the following command in the Terminal.

svn import project http://repository -m "Place comments here."

svn import project http://repository -m "Place comments here."

Filed Under: SVN Tagged With: import

Subversion Tag

November 2, 2012

Subversion Tags are snapshots of a project at a certain time. Tags are ideal for version releases. To create a tag, you will need to type the following command in the Terminal. It’s a good idea when creating a project that you create a tag directory under the project directory. The tag directory will be the place where you can store all your tag releases in an organized way.

svn copy http://repository/project/trunk \ 
         http://repository/project/tags/1.0 \ 
         -m "Place comments here."

svn copy http://repository/project/trunk \ http://repository/project/tags/1.0 \ -m "Place comments here."

Filed Under: SVN Tagged With: tag

Git Add

November 2, 2012

The Git Add command will add files to the current local working repository. This is how files are officially added to the local repository. You can specify one file or multiple files by using wildcards.

Add one file

git add sample.php

git add sample.php

Add all files

git add .

git add .

Add all PHP files

git add *.php

git add *.php

Filed Under: Git Tagged With: add

Git Clone

November 2, 2012

Git Clone is a command used to make a copy of a Git repository to your local drive. It creates a new directory and creates a clone of the repository on the local drive. In the example below, a clone of an existing repository from Github is placed on the local computer. You initiate a clone by typing the following command on the Terminal.

// old way. does not work anymore.
git clone git@github.com:username/Project.git
 
// new way. use this from this point on.
git clone https://github.com/username/Project

// old way. does not work anymore. git clone git@github.com:username/Project.git // new way. use this from this point on. git clone https://github.com/username/Project

Filed Under: Git Tagged With: clone

Git Init

November 2, 2012

Git init is a command to start a new repository or reinitialize an existing one. You will need to type this command in the Terminal in the desired directory of your choice to start new repository.

git init

git init

There are options or switches you can add. See the manual.

Filed Under: Git Tagged With: init

Subversion Commit

November 2, 2012

Once you are done editing, and are through with making file changes in the local working directory, you have the option to commit the changes to the Subversion repository. You simply type the following command from the Terminal to initiate a commit.

svn commit -m "Place your comment here"

svn commit -m "Place your comment here"

I encourage that you add comments, so you’ll know exactly what changes you’ve applied. Going forward, it will be easier to keep track of changes as you apply hundreds of commits to a project.

Filed Under: SVN Tagged With: commit

CSS Style Switcher

October 28, 2012

Years ago, I implemented an alternative style switcher I found at A List Apart. But, that solution is quite old now. It was published eleven years ago, back in 2001. Now, I’m looking for something a little bit more modern, perhaps a solution that uses JQuery. The idea is to let the readers choose a CSS stylesheet of their liking by simply clicking on a link. So, here’s the finished product. Demo.

The Stylesheet

I’m using two very simple stylesheets. The default stylsheet is called style.css. The alternate stylesheet is called black.css. This code belongs in the head section of the HTML page.

<link rel="stylesheet" type="text/css" href="style.css" title="style" >
<link rel="alternate stylesheet" type="text/css" href="black.css" title="black" >

<link rel="stylesheet" type="text/css" href="style.css" title="style" > <link rel="alternate stylesheet" type="text/css" href="black.css" title="black" >

JQuery

We are using Google’s JQuery CDN by also linking it from within the head section of the HTML page. The second line is the Javascript code that actually performs the stylesheet switching. You can download the styleswitcher.js code directly from my website.

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script type="text/javascript" src="styleswitcher.js"></script>

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script> <script type="text/javascript" src="styleswitcher.js"></script>

CSS Switch

We will provide two links where readers can switch stylesheets from default to black and vice versa. The links are standard HTML links and using Javascript’s onclick event.

<a href="#" onclick="setActiveStyleSheet('style');return false;">Default</a> |
<a href="#" onclick="setActiveStyleSheet('black');return false;">Black</a>

<a href="#" onclick="setActiveStyleSheet('style');return false;">Default</a> | <a href="#" onclick="setActiveStyleSheet('black');return false;">Black</a>

Putting It All Together

Here’s the final code.

<!DOCTYPE html>
<head>
<title>CSS Switcher</title>
<link rel=”stylesheet” type=”text/css” href=”style.css” title=”style” />
<link rel=”alternate stylesheet” type=”text/css” href=”black.css” title=”black” />
<script src=”//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js”></script>
<script type=”text/javascript” src=”styleswitcher.js”></script>
</head>
<body>
<a href=”#” onclick=”setActiveStyleSheet(‘style’);return false;”>Default</a> | 
<a href=”#” onclick=”setActiveStyleSheet(‘black’);return false;”>Black</a>
</body>
</html>

<!DOCTYPE html> <head> <title>CSS Switcher</title> <link rel=”stylesheet” type=”text/css” href=”style.css” title=”style” /> <link rel=”alternate stylesheet” type=”text/css” href=”black.css” title=”black” /> <script src=”//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js”></script> <script type=”text/javascript” src=”styleswitcher.js”></script> </head> <body> <a href=”#” onclick=”setActiveStyleSheet(‘style’);return false;”>Default</a> | <a href=”#” onclick=”setActiveStyleSheet(‘black’);return false;”>Black</a> </body> </html>

Demo

Happy switching!

Filed Under: CSS, HTML, JS Tagged With: styleswitcher

Subversion Add

October 26, 2012

Adding a file or directory to Subversion is quite easy. The following commands will add a file and a directory to the current Subversion working directory. The added file or directory is only added to the local working directory, and not to the Subversion repository. For that to happen, you’ll need to issue a Subversion commit to synch the files to the repository. The following commands simply add files and directories in the local working directory.

Add a file

svn add foo.c

svn add foo.c

Add a directory

svn add directory

svn add directory

Filed Under: SVN Tagged With: add

  • « Go to Previous Page
  • Go to page 1
  • Interim pages omitted …
  • Go to page 122
  • Go to page 123
  • Go to page 124
  • Go to page 125
  • Go to Next Page »
  • Home
  • About
  • Archives

Copyright © 2023