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
/** | |
* Converts a company name into a site slug. | |
* @param {String} value | |
* @returns {string} | |
*/ | |
var createSlug = function(value) { | |
if (_.isEmpty(value)) { //lodash call | |
return ''; | |
} |
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
# https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager | |
sudo apt-get update | |
sudo apt-get install -y python-software-properties python g++ make | |
sudo apt-get install software-properties-common | |
sudo add-apt-repository ppa:chris-lea/node.js | |
sudo apt-get update | |
sudo apt-get --purge remove node | |
sudo apt-get --purge remove nodejs | |
sudo apt-get install nodejs |
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
sudo apt-get install git | |
sudo apt-get install npm | |
npm install -g bower | |
npm install | |
bower install |
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
public class QueryStringBuilder : NameValueCollection | |
{ | |
public QueryStringBuilder() | |
: base(StringComparer.InvariantCultureIgnoreCase) { } | |
public QueryStringBuilder(NameValueCollection collection) | |
: base(StringComparer.InvariantCultureIgnoreCase) | |
{ | |
Add(collection); | |
} |
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
/// <summary> | |
/// Helper methods for determining the platform. | |
/// </summary> | |
public static class Platform | |
{ | |
/// <summary> | |
/// Gets if the platform is Windows NT or later. | |
/// </summary> | |
public static bool IsWindows | |
{ |
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
public class AdHelper | |
{ | |
public WindowsAccount GetWindowsAccount(string username = "") | |
{ | |
// NOTE: If the username is not specified, use the current users account | |
// The username should also include the domain if available | |
var identity = String.IsNullOrWhiteSpace(username) | |
? WindowsIdentity.GetCurrent().Name | |
: username; |
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
public class ImageMagick : IDisposable | |
{ | |
IntPtr _wand; | |
public ImageMagick(string file) | |
{ | |
var data = File.ReadAllBytes(file); | |
Initialise(data); | |
} |
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
public static class TimeExtensions | |
{ | |
// Good website for conversions: | |
// http://www.epochconverter.com/ | |
// ToUnixTime(DateTime.Parse("20/10/2014 12:00:00 AM")) - should equal 1413734400 | |
public static long ToUnixTime(this DateTime date) | |
{ | |
return (date.ToUniversalTime().Ticks - 621355968000000000) / 10000000; |
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
Get-ChildItem .\ -include bin,obj,_ReSharper* -Recurse | foreach ($_) { remove-item $_.fullname -Force -Recurse } |
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
create or replace procedure delete_object(object_name varchar2, object_type varchar2) | |
is | |
v_counter number := 0; | |
begin | |
if object_type = 'TABLE' then | |
select count(*) into v_counter from user_tables where table_name = upper(object_name); | |
if v_counter > 0 then | |
execute immediate 'drop table ' || object_name || ' cascade constraints'; | |
dbms_output.put_line('table ' || object_name || ' deleted'); | |
end if; |
OlderNewer