This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# first: | |
lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done | |
sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.* | |
# To recap, the best way (I've found) to completely uninstall node + npm is to do the following: | |
# go to /usr/local/lib and delete any node and node_modules | |
cd /usr/local/lib | |
sudo rm -rf node* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
const electron = require('electron'); | |
// below is just plain angular stuff | |
System | |
.config({ | |
packages: { | |
angular: { | |
format: 'register', | |
defaultExtension: 'js' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var urlLib = require('url'); | |
function UrlAdapter(urlString) { | |
this.urlObj = urlLib.parse(urlString, true); | |
// XXX remove the search property to force format() to use the query object when transforming the url object to a string | |
delete this.urlObj.search; | |
} | |
exports.UrlAdapter = UrlAdapter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git branch -m old_branch new_branch # Rename branch locally | |
git push origin :old_branch # Delete the old branch | |
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote | |
#Set of commands i use to rename feature/15.0 to feature/SignupRefactor locally and remotely | |
#rename local feature/15.0 to feature/SignupRefactor | |
git branch -m feature/15.0 feature/SignupRefactor | |
#delete remote feature/15.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
C# Generic String Parser Extension Method | |
Code Snippet By: Pinal Bhatt [www.PBDesk.com] | |
http://blogs.pbdesk.com/c-generic-string-parser-extension-method/ | |
Working Example at http://ideone.com/ZP5xo | |
Usage: | |
string s = "32"; | |
int i = s.As<int>(); | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
C# Generic Enum Parser With Extension Methods | |
Code Snippet By: Pinal Bhatt [www.PBDesk.com] | |
*/ | |
public static class EnumUtils | |
{ | |
#region String to Enum |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
C# Some Handy String Extension Methods | |
Code Snippet By: Pinal Bhatt [www.PBDesk.com] | |
*/ | |
using System; | |
public static class StringExtensions | |
{ | |
/// <summary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Dynamic; | |
namespace WW.COM.Framework.WWConfiguration | |
{ | |
public class EnvSettings : DynamicObject | |
{ | |
private string Category { get; set; } | |
public EnvSettings() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Javascript function to read QueryString parameters. | |
More details bloged at http://blog.pbdesk.com/2008/11/reading-query-string-with-javascript.html | |
JSFiddle: http://jsfiddle.net/PinalBhatt/sBkur/ | |
*/ | |
function GetQueryStringValue(parameterName) { | |
var objQRs = new Object(); | |
window.location.search.replace(new RegExp("([^?=&]+)(=([^&]*))?", "g"), |
NewerOlder