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 the column names, data types, max lengt, precision, scale, nullable flag and primary key flag from a SQL table. Works for SQL 2005 and above. Simply replace the 'TABLE_NAME_HERE' with your table name. */ | |
SELECT | |
c.name 'Column Name', | |
t.Name 'Data type', | |
c.max_length 'Max Length', | |
c.precision , | |
c.scale , | |
c.is_nullable, | |
ISNULL(i.is_primary_key, 0) 'Primary Key' | |
FROM |
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
.directive('numbersOnly', function () { | |
return { | |
restrict: 'A', | |
link: function (scope, elm, attrs, ctrl) { | |
// record ctrl key being down for ctrl+v and ctrl+c | |
var ctrlDown = false; | |
// reset the ctrl key flag on keyup | |
elm.on('keyup', function (event) { | |
ctrlDown = false; | |
}); |
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
set-alias np C:\Windows\notepad.exe | |
set-alias subl "C:\Program Files\Sublime Text 3\sublime_text.exe" | |
set-alias grep select-string | |
$currentPrincipal = New-Object Security.Principal.WindowsPrincipal( [Security.Principal.WindowsIdentity]::GetCurrent() ) | |
$isAdmin = $currentPrincipal.IsInRole( [Security.Principal.WindowsBuiltInRole]::Administrator ) | |
$host.ui.RawUI.BackgroundColor = [ConsoleColor]::Black | |
function prompt | |
{ |
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
alias c='clear' | |
alias 1='clear; ls -1F --color=always | more' | |
alias 2='clear; ls -lF --color=always | more' | |
alias 3='clear; ls -laF --color=always | more' | |
alias hosts='subl /private/etc/hosts' | |
PS1='\[\e[31m\][\[\e[34m\]$PWD\[\e[31m\]]\[\e[0m\]# ' | |
export PATH=/usr/local/bin:$PATH:: | |
shopt -s extglob | |
umask 022 |
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
alias c='clear' | |
alias 1='clear; CLICOLOR_FORCE=1; ls -1FG | more -R; CLICOLOR_FORCE=0' | |
alias 2='clear; CLICOLOR_FORCE=1; ls -lFG | more -R; CLICOLOR_FORCE=0' | |
alias 3='clear; CLICOLOR_FORCE=1; ls -laFG | more -R; CLICOLOR_FORCE=0' | |
alias hosts='subl /private/etc/hosts' | |
PS1='\[\e[31m\][\[\e[34m\]$PWD\[\e[31m\]]\[\e[0m\]# ' | |
export PATH=/usr/local/bin:$PATH:: | |
shopt -s extglob | |
umask 022 |
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 npm cache clean -f | |
sudo npm install -g n | |
sudo n stable |
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; | |
public abstract class Singleton<T> where T : class | |
{ | |
private static readonly Lazy<T> _instance = new Lazy<T>(() => CreateInstance()); | |
public static T Instance { get { return _instance.Value; } } | |
private static T CreateInstance() | |
{ |