Skip to content

Instantly share code, notes, and snippets.

View PilotBob's full-sized avatar

Bob Archer PilotBob

View GitHub Profile
@PilotBob
PilotBob / kendouibundle.cs
Created December 14, 2017 19:21
KendoUI for MVC bundle pointing to NuGet package installed Content and Script folders
// KendoUI Bundles
var path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "bin");
var kendoVersion = Assembly.LoadFrom(Path.Combine(path, "Kendo.Mvc.dll")).GetName().Version;
var kendoFormatedVersion = $"{kendoVersion.Major}.{kendoVersion.Minor}.{kendoVersion.Build}";
bundles.Add(new ScriptBundle("~/bundles/kendoui").Include(
$"~/Scripts/kendo/{kendoFormatedVersion}/kendo.all.min.js"));
bundles.Add(new StyleBundle("~/Content/kendoui").Include(
$"~/Content/kendo/{kendoFormatedVersion}/kendo.common.min.css",
$"~/Content/kendo/{kendoFormatedVersion}/kendo.blueopal.min.css"));
if I do this:
var result = db.People.Where(p => p.first = "pilot" && p.last = "bob").Select(p => p.Id).SingleOrDefault();
Can I later do this and expect to find a result?
var result = db.People.Local.Where(p => p.first = "pilot" && p.last = "bob").Select(p => p.Id).SingleOrDefault();
Or since I did a projection is the entity not actually loaded into the context?
while($data =~ /\<b\>.*?\[\W*?$type\W*?(.*?)\].*?\<\/b\>/i)
{
$votee = lc($1);
$type = lc($type);
$votee =~ s/\<img src=.*\/(.*?)\.gif.*?\>/$1/i;
$name = lc($votee);
vote_check:begin
declare tally_id int(11);
declare new_count int(11);
declare new_tally int(1);
declare nightfall int(1);
if new.valid != 1 then
leave vote_check;
end if;
set new_tally := 0;
@PilotBob
PilotBob / boxstarter.txt
Last active January 27, 2018 19:44
My Boxstarter Script
# Boxstarter options
$Boxstarter.RebootOk=$true # Allow reboots?
$Boxstarter.NoPassword=$false # Is this a machine with no login password?
$Boxstarter.AutoLogin=$true # Save my password securely and auto-login after a reboot
# Basic setup
Update-ExecutionPolicy Unrestricted
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowFileExtensions -EnableShowFullPathInTitleBar
Enable-RemoteDesktop
$.ajax(baseUrl + "/eFinancials/Lookup/JobForProperty",
{
data: {
property: propertyIdField.val(),
allJobs: true,
term: jobIdField.val()
},
success: function (data) {
if (data[0]) {
jobKeyField.val(data[0].id);
function SaveGridAsync() {
ClearErrors();
var myPromises = $(".open-sub-grid").map(function (i, o) {
var subGridData = $(o).data("kendoGrid");
return subGridData.dataSource.sync();
}).get();
return $.when.apply($, myPromises)
.then(function () {
var GetGridState = function(dataSource, grid$) {
var state = {
page: dataSource.page(),
pageSize: dataSource.pageSize(),
sort: dataSource.sort(),
group: dataSource.group(),
filter: dataSource.filter(),
scroll: $(".k-grid-content", grid$).scrollTop(),
aggregate: dataSource.aggregate()
};
<Variables><Variable Name="SSRSPath"><Value>AP/Vendors</Value></Variable></Variables>
Given the above XML fragment (it's actually just part of the XDocument) have do I get the value of the Variable element where Name="SSRSPath" ???
var path = from x in doc.DescenDescendants(ns + "Variables")
ok, that gets me the variables XElement (there is only one). Now what?
Using C#.
public ActionResult SetCookies()
{
Response.Cookies.Add(new HttpCookie("Cookie1", "Test 1"));
Response.Cookies.Add(new HttpCookie("Cookie2", "Test 2"));
Response.Cookies.Add(new HttpCookie("Cookie3", "Test 3"));
return View("Index");
}
public ActionResult DeleteCookies()