I hereby claim:
- I am jamiehowarth0 on github.
- I am jamiehowarth0 (https://keybase.io/jamiehowarth0) on keybase.
- I have a public key ASC3Uo_2h4jCSkRsHZE1Gc4u4-pcQXGSiY3aSv5vemKujAo
To claim this, I am signing this object:
public static class StringExtensions { | |
public static bool ToBoolean(this string str, bool bDefault = false) { | |
var BooleanStringOff = new[] { "0", "off", "no" }; | |
if (string.IsNullOrEmpty(str)) return bDefault; | |
else if (BooleanStringOff.Contains(str, StringComparer.InvariantCultureIgnoreCase)) return false; | |
bool result; | |
if (!bool.TryParse(str, out result)) result = true; | |
return result; | |
} | |
} |
# A crontab to turn pi-hole groups on and off at set times of day, Mon-Fri | |
# Replace <work group> and <personal group> with the names of your own groups that you've established. | |
# Both my groups are pinned to my laptop's IP, so enabling the "Work" list, which whitelists Google Analytics, | |
# only affects one device. | |
* 18 * * 1-5 root sqlite3 -line /etc/pihole/gravity.db "UPDATE [group] SET [enabled] = 0 WHERE [name] = '<work group>'; UPDATE [group] SET [enabled] = 1 WHERE [name] = '<personal group>';" && pihole restartdns reload-lists | |
* 9 * * 1-5 root sqlite3 -line /etc/pihole/gravity.db "UPDATE [group] SET [enabled] = 1 WHERE [name] = '<work group>'; UPDATE [group] SET [enabled] = 0 WHERE [name] = '<personal group>';" && pihole restartdns reload-lists |
# ASP.NET | |
# Build and test ASP.NET projects. | |
# Add steps that publish symbols, save build artifacts, deploy, and more: | |
# https://docs.microsoft.com/azure/devops/pipelines/apps/aspnet/build-aspnet-4 | |
trigger: | |
- master | |
- develop | |
pool: |
function PiOn() { | |
$conn = Get-NetAdapter -physical | Where-Object Status -eq "Up" | |
Set-DnsClientServerAddress -InterfaceIndex $conn.InterfaceIndex -ResetServerAddresses | |
} | |
function PiOff() { | |
$conn = Get-NetAdapter -physical | Where-Object Status -eq "Up" | |
$gateway = Get-NetIpConfiguration | Foreach IPv4DefaultGateway | Select-Object NextHop | |
# This assumes the current gateway is your home router & your router still issues DHCP (instead of Pi-Hole). | |
# If it's not, then uncomment the following line and specify your router's IP address. |
public class FixNvarcharContentInstallTask : AUmbracoDbInstallTask | |
{ | |
public override void Install() | |
{ | |
// Get all property types using the datatype | |
var datatype = ApplicationContext.Current.Services.DataTypeService.GetDataTypeDefinitionByPropertyEditorAlias( | |
"TeaCommerce.VariantEditor").FirstOrDefault(); | |
var allContentTypes = ApplicationContext.Current.Services.ContentTypeService.GetAllContentTypes(); | |
var hasVariantPicker = allContentTypes.Where(ct => ct.PropertyTypes.Any(prop => prop.DataTypeDefinitionId == datatype.Id)); | |
var propIds = hasVariantPicker.SelectMany(ct => ct.PropertyTypes) |
pip install dnspython monotonic pillow psutil pypiwin32 requests ujson tornado marionette_driver selenium | |
cd $env:USERPROFILE | |
git clone https://github.com/WPO-Foundation/browser-install.git .\browser-install | |
git clone https://github.com/WPO-Foundation/wptagent.git .\wptagent | |
python .\browser-install\browser-install.py --all -vvvv | |
schtasks /delete /tn WPTPostInstall /f |
I hereby claim:
To claim this, I am signing this object:
gci -Include "*.cshtml" -recurse | select -expand FullName | where { -not [string]::IsNullOrEmpty($_) } | foreach { Select-String -Path $_ -Pattern '~(.*\.js)' -AllMatches } | foreach {$_.Matches.Groups[1].Value} | Sort-Object | Get-Unique -AsString > .\alljs.txt |
<?xml version="1.0" encoding="UTF-8"?> | |
<jmeterTestPlan version="1.2" properties="2.6" jmeter="2.11 r1554548"> | |
<hashTree> | |
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Test Plan" enabled="true"> | |
<stringProp name="TestPlan.comments"></stringProp> | |
<boolProp name="TestPlan.functional_mode">false</boolProp> | |
<boolProp name="TestPlan.serialize_threadgroups">false</boolProp> | |
<elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true"> | |
<collectionProp name="Arguments.arguments"/> | |
</elementProp> |
public static class IMediaServiceExtensions { | |
private const string UmbFile = "umbracoFile"; | |
public static IMedia Copy(this IMediaService mediaService, IMedia media, IMedia newLocation, string newName = "") { | |
var properNewName = string.IsNullOrEmpty(newName) ? media.Name : newName; | |
var newMedia = (newLocation == null) ? mediaService.CreateMedia(properNewName, -1, media.ContentType.Alias) | |
: mediaService.CreateMedia(properNewName, newLocation, media.ContentType.Alias); | |
if (media.HasProperty(UmbFile)) { |