As easy as 1, 2, 3!
Updated:
- Aug, 08, 2022 update
configdocs for npm 8+ - Jul 27, 2021 add private scopes
- Jul 22, 2021 add dist tags
- Jun 20, 2021 update for
--access=public - Sep 07, 2020 update docs for
npm version
| // | |
| // Regular Expression for URL validation | |
| // | |
| // Author: Diego Perini | |
| // Created: 2010/12/05 | |
| // Updated: 2018/09/12 | |
| // License: MIT | |
| // | |
| // Copyright (c) 2010-2018 Diego Perini (http://www.iport.it) | |
| // |
| #!/bin/sh | |
| echo "What should the Application be called (no spaces allowed e.g. GCal)?" | |
| read inputline | |
| name="$inputline" | |
| echo "What is the url (e.g. https://www.google.com/calendar/render)?" | |
| read inputline | |
| url="$inputline" |
| #301 Redirects for .htaccess | |
| #Redirect a single page: | |
| Redirect 301 /pagename.php http://www.domain.com/pagename.html | |
| #Redirect an entire site: | |
| Redirect 301 / http://www.domain.com/ | |
| #Redirect an entire site to a sub folder | |
| Redirect 301 / http://www.domain.com/subfolder/ |
| #!/usr/bin/env ruby | |
| # This pre-commit hook will prevent any commit to forbidden branches | |
| # (by default, "staging" and "production"). | |
| # Put this file in your local repo, in the .git/hooks folder | |
| # and make sure it is executable. | |
| # The name of the file *must* be "pre-commit" for Git to pick it up. | |
| FORBIDDEN_BRANCHES = ["staging", "production"] |
| #Model | |
| @user.should have(1).error_on(:username) # Checks whether there is an error in username | |
| @user.errors[:username].should include("can't be blank") # check for the error message | |
| #Rendering | |
| response.should render_template(:index) | |
| #Redirecting | |
| response.should redirect_to(movies_path) |
| // Add a getElementsByClassName function if the browser doesn't have one | |
| // Limitation: only works with one class name | |
| // Copyright: Eike Send http://eike.se/nd | |
| // License: MIT License | |
| if (!document.getElementsByClassName) { | |
| document.getElementsByClassName = function(search) { | |
| var d = document, elements, pattern, i, results = []; | |
| if (d.querySelectorAll) { // IE8 | |
| return d.querySelectorAll("." + search); |
| #!/bin/sh | |
| ### | |
| # SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer) | |
| # For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos | |
| ### | |
| # Alot of these configs have been taken from the various places | |
| # on the web, most from here | |
| # https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx |
| [url "[email protected]:L2G/"] | |
| insteadOf = "github:///L2G/" | |
| insteadOf = "http://github.com/L2G/" | |
| insteadOf = "https://github.com/L2G/" | |
| [url "https://github.com/"] | |
| insteadOf = "github:///" | |
| insteadOf = "http://github.com/" |
| /* | |
| Grep.js | |
| Author : Nic da Costa ( @nic_daCosta ) | |
| Created : 2012/11/14 | |
| Version : 0.2 | |
| (c) Nic da Costa | |
| License : MIT, GPL licenses | |
| Overview: | |
| Basic function that searches / filters any object or function and returns matched properties. |