# install ollama
brew install --cask ollama
# install continue.dev
code --install-extension Continue.continue
#Transform web.config on build
- Unload the project
- Edit .csproj
- Append figure 1 to the end of the file just before
</Project>
; v12.0 my change depending on your version of Visual Studio - Save .csproj and reload
- Open configuration manager
- Add a new Configuration Name: Base. Copy settings from: Release
- Copy the contents of your web.config
- Right click Web.Config > Add Config Transformation
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
declare @procName varchar(500) | |
declare cur cursor | |
for select [name] from sys.objects where type = 'p' | |
open cur | |
fetch next from cur into @procName | |
while @@fetch_status = 0 | |
begin | |
exec('drop procedure [' + @procName + ']') | |
fetch next from cur into @procName |
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
SELECT | |
t.NAME AS TableName, | |
s.Name AS SchemaName, | |
p.rows AS RowCounts, | |
SUM(a.total_pages) * 8 AS TotalSpaceKB, | |
CAST(ROUND(((SUM(a.total_pages) * 8) / 1024.00), 2) AS NUMERIC(36, 2)) AS TotalSpaceMB, | |
SUM(a.used_pages) * 8 AS UsedSpaceKB, | |
CAST(ROUND(((SUM(a.used_pages) * 8) / 1024.00), 2) AS NUMERIC(36, 2)) AS UsedSpaceMB, | |
(SUM(a.total_pages) - SUM(a.used_pages)) * 8 AS UnusedSpaceKB, | |
CAST(ROUND(((SUM(a.total_pages) - SUM(a.used_pages)) * 8) / 1024.00, 2) AS NUMERIC(36, 2)) AS UnusedSpaceMB |
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 string RenderRazorViewToString(Controller controller, string viewName, object model) | |
{ | |
controller.ViewData.Model = model; | |
using (var sw = new StringWriter()) | |
{ | |
var viewResult = ViewEngines.Engines.FindPartialView(controller.ControllerContext, viewName); | |
var viewContext = new ViewContext(controller.ControllerContext, viewResult.View, controller.ViewData, controller.TempData, sw); | |
viewResult.View.Render(viewContext, sw); | |
viewResult.ViewEngine.ReleaseView(controller.ControllerContext, viewResult.View); | |
return sw.GetStringBuilder().ToString(); |
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
git config --global url."https://".insteadOf git:// |
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 string ToTitleCase(this string str) | |
{ | |
return CultureInfo.CurrentCulture.TextInfo.ToTitleCase(str.ToLower()); | |
} |
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 T DictionaryToObject<T>(IDictionary<string, string> dict) where T : new() | |
{ | |
var t = new T(); | |
PropertyInfo[] properties = t.GetType().GetProperties(); | |
foreach (PropertyInfo property in properties) | |
{ | |
if (!dict.Any(x => x.Key.Equals(property.Name, StringComparison.InvariantCultureIgnoreCase))) | |
continue; |
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 StaticPropertyContractResolver : DefaultContractResolver | |
{ | |
protected override List<MemberInfo> GetSerializableMembers(Type objectType) | |
{ | |
var baseMembers = base.GetSerializableMembers(objectType); | |
PropertyInfo[] staticMembers = | |
objectType.GetProperties(BindingFlags.Static | BindingFlags.Public); | |
baseMembers.AddRange(staticMembers); |
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
function isJson(str) { | |
try { | |
JSON.parse(str); | |
} catch (e) { | |
return false; | |
} | |
return true; | |
} |
NewerOlder