This file contains hidden or 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
| Sub FindNextValueChangeInColumn() | |
| ' | |
| ' FindNextValueChangeInColumn Macro | |
| ' | |
| On Error GoTo ErrHandler | |
| Dim currentValue As String | |
| Dim compareValue As String | |
| currentValue = ActiveCell.Value |
This file contains hidden or 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 table [dbo].[AspNetRoleClaims] ( | |
| [Id] int IDENTITY(1, 1) not null, | |
| [RoleId] nvarchar(450) not null, | |
| [ClaimType] nvarchar(MAX) null, | |
| [ClaimValue] nvarchar(MAX) null, | |
| constraint [PK_AspNetRoleClaims] primary key clustered ([Id] asc) | |
| ); | |
| go | |
| create nonclustered index [IX_AspNetRoleClaims_RoleId] on [dbo].[AspNetRoleClaims] ([RoleId] asc); |
This file contains hidden or 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
| # copy files older than a given date | |
| $items = Get-ChildItem -Path ".\" | Where-Object { $_.CreationTime -le "12/31/2017" } | |
| Write-Output "count $($items.Length)" | |
| foreach ($item in $items) | |
| { | |
| Move-Item -Path $item.FullName -Destination "c:\destination\$($item.Name)" | |
| } |
This file contains hidden or 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 to generate sp_rename commands for all check constraints | |
| select | |
| ck.name as current_name | |
| ,po.name as ParentObject | |
| ,po.type_desc as ParentType | |
| ,ISNULL(pc.name, N'') as ColumnName | |
| ,'exec sp_rename @objname = N''[' + ps.name + '].[' + ck.name + ']'', @newname = ''CK_' + po.name + '_' + pc.name + '''' as rename_cmd | |
| from | |
| sys.check_constraints ck | |
| left join sys.objects po on (ck.parent_object_id = po.object_id) |
This file contains hidden or 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
| -- Google Chrome stores dates in microseconds since 1601-01-01 in the `keywords` sqlite table | |
| -- the following line generates that value | |
| -- select (strftime('%s', datetime('now')) + 11644473600) * 1000000 | |
| -- algo used to generate a uuid per row | |
| -- select lower(hex(randomblob(4))) || '-' || lower(hex(randomblob(2))) || '-4' || substr(lower(hex(randomblob(2))),2) || '-' || substr('89ab',abs(random()) % 4 + 1, 1) || substr(lower(hex(randomblob(2))),2) || '-' || lower(hex(randomblob(6))) | |
| /* | |
| Variables are not supported in sqlite. |
This file contains hidden or 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
| param ( | |
| [string]$path = "c:\dev\" | |
| ) | |
| Write-Output "Recurse in $path for hidden .git folders..." | |
| $gitdirs = Get-ChildItem -Recurse -Path $path -Force -Filter ".git" | |
| Write-Output "Found: $($gitdirs.Length) repos" |
This file contains hidden or 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 GoogleContactService | |
| { | |
| public void CreateContact() | |
| { | |
| var cr = this.CreateContactsRequest(); | |
| var groups = cr.GetGroups().Entries.ToList(); | |
| var myContactsSystemGroup = groups.FirstOrDefault(x => x.SystemGroup == "Contacts"); | |
| var newContact = new Contact(); | |
This file contains hidden or 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
| convert(char(48), HASHBYTES('sha1', @HashInput), 2) | |
| convert(char(64), HASHBYTES('sha2_256', @HashInput), 2) |
This file contains hidden or 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 void OnPropertyChanged<T>( | |
| this INotifyPropertyChanged @this, | |
| PropertyChangedEventHandler propertyChanged, | |
| Expression<Func<T>> propertyExpr) | |
| { | |
| if (propertyChanged == null) return; | |
| var memberExpr = (MemberExpression)propertyExpr.Body; | |
| var ea = new PropertyChangedEventArgs(memberExpr.Member.Name); |
This file contains hidden or 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
| -----BEGIN PGP SIGNED MESSAGE----- | |
| Hash: SHA512 | |
| keybase is fun! | |
| -----BEGIN PGP SIGNATURE----- | |
| Version: Keybase OpenPGP v2.0.76 | |
| Comment: https://keybase.io/crypto | |
| wsBcBAABCgAGBQJaJtRyAAoJEGnJ5Wt+lYeyjTIH/13v97tzANkiSM3i+Vbr9Q8g | |
| isis5gh3+4slL2SgsiF0YvnUH5o2hycYArm6r05DLdPZ2rja1YEzB1K0IV2EoAad |