Skip to content

Instantly share code, notes, and snippets.

View RobotOptimist's full-sized avatar

James RobotOptimist

View GitHub Profile
@RobotOptimist
RobotOptimist / image-from-builtin-content-type.md
Created February 12, 2020 14:19
Sitefinity code snippits and explanations

get an image from a built in content type

For news and events content items you can't use the built in GetRelatedItems or anything like you would with a Dynamic Content Item. Instead you have to do this to get a related item, this is for an Image (in cshtml):

@model Telerik.Sitefinity.Frontend.Mvc.Models.ContentDetailsViewModel

@using Telerik.Sitefinity.Libraries.Model
@RobotOptimist
RobotOptimist / Salary_Data.csv
Last active November 18, 2020 16:30
Simple Regression in Python
YearsExperience Salary
1.1 39343.00
1.3 46205.00
1.5 37731.00
2.0 43525.00
2.2 39891.00
2.9 56642.00
3.0 60150.00
3.2 54445.00
3.2 64445.00
@RobotOptimist
RobotOptimist / Dockerfile
Last active November 22, 2020 19:56
MLNET Simple Regression
FROM jmacivor/dotnet-binder:0.1.1
ARG NB_USER=jovyan
ARG NB_UID=1000
USER $NB_USER
ENV HOME=/home/$NB_USER
WORKDIR $HOME
@RobotOptimist
RobotOptimist / Dockerfile
Created November 22, 2020 20:01
Binder Dotnet Dockerfile For Base Image
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-focal
USER root
RUN cd /tmp
# now get the key:
RUN wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB
# now install that key
RUN apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB
# now remove the public key file exit the root shell
RUN rm GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB
@RobotOptimist
RobotOptimist / 50_Startups.csv
Last active December 3, 2020 18:43
Python Multiple Linear Regression
R&D Spend Administration Marketing Spend State Profit
165349.2 136897.8 471784.1 New York 192261.83
162597.7 151377.59 443898.53 California 191792.06
153441.51 101145.55 407934.54 Florida 191050.39
144372.41 118671.85 383199.62 New York 182901.99
142107.34 91391.77 366168.42 Florida 166187.94
131876.9 99814.71 362861.36 New York 156991.12
134615.46 147198.87 127716.82 California 156122.51
130298.13 145530.06 323876.68 Florida 155752.6
120542.52 148718.95 311613.29 New York 152211.77
@RobotOptimist
RobotOptimist / 50_Startups.csv
Last active December 6, 2020 12:58
ML.NET Multiple Linear Regression
165349.2 136897.8 471784.1 New York 192261.83
162597.7 151377.59 443898.53 California 191792.06
153441.51 101145.55 407934.54 Florida 191050.39
144372.41 118671.85 383199.62 New York 182901.99
142107.34 91391.77 366168.42 Florida 166187.94
131876.9 99814.71 362861.36 New York 156991.12
134615.46 147198.87 127716.82 California 156122.51
130298.13 145530.06 323876.68 Florida 155752.6
120542.52 148718.95 311613.29 New York 152211.77
@RobotOptimist
RobotOptimist / Dockerfile
Last active December 16, 2020 17:59
Wealth Disparity By Luck
FROM jmacivor/dotnet-binder:0.1.1
ARG NB_USER=jovyan
ARG NB_UID=1000
USER $NB_USER
ENV HOME=/home/$NB_USER
WORKDIR $HOME
Position Level Salary
Business Analyst 1 45000
Junior Consultant 2 50000
Senior Consultant 3 60000
Manager 4 80000
Country Manager 5 110000
Region Manager 6 150000
Partner 7 200000
Senior Partner 8 300000
C-level 9 500000
@RobotOptimist
RobotOptimist / Dockerfile
Last active December 21, 2020 01:59
ML.NET polynomial regression
FROM jmacivor/dotnet-binder:0.1.1
ARG NB_USER=jovyan
ARG NB_UID=1000
USER $NB_USER
ENV HOME=/home/$NB_USER
WORKDIR $HOME
@RobotOptimist
RobotOptimist / packageUpdater.ps1
Created March 8, 2021 20:57
PowerShell get nuget versions and update package.config
$nugetValues = Find-Package -Source "The Feed" | Select-Object Name, Version
$filePath = "muh\path\mmkay\packages.config"
[xml]$file = Get-Content -Path $filePath
foreach ($package in $file.packages.package) {
$nugetVersion = ($nugetValues | Where-Object Name -eq $package.id | Select-Object Version).Version
$nugetVersion
if ($null -ne $nugetVersion -and $nugetVersion -ne '') {
$package.version = $nugetVersion