Skip to content

Instantly share code, notes, and snippets.

View markthiessen's full-sized avatar
💭
🐝 🐝 🐝 🍯

Mark Thiessen markthiessen

💭
🐝 🐝 🐝 🍯
View GitHub Profile
@markthiessen
markthiessen / getWeeksInMonth.js
Last active April 25, 2024 02:05
JavaScript - get weeks in a month as array of start and end days
//note: month is 0 based, just like Dates in js
function getWeeksInMonth(year, month) {
const weeks = [],
firstDate = new Date(year, month, 1),
lastDate = new Date(year, month + 1, 0),
numDays = lastDate.getDate();
let dayOfWeekCounter = firstDate.getDay();
for (let date = 1; date <= numDays; date++) {
@markthiessen
markthiessen / PrimeFetcher.cs
Created November 20, 2012 05:49
Fetch Primes C#
public class PrimeFetcher
{
public IEnumerable<int> FetchPrimesUpTo(int max)
{
if (max <= 1)
return Enumerable.Empty<int>();
var range = Enumerable.Range(0, max + 1).ToArray();
range[1] = 0;
@markthiessen
markthiessen / DisableSslv3.ps1
Created October 20, 2014 15:11
PowerShell script for disabling SSLv3 - Refactored
# MS Security bulletin: https://technet.microsoft.com/en-us/library/security/3009008.aspx
# Azure post where this script originally came from: http://azure.microsoft.com/blog/2014/10/19/how-to-disable-ssl-3-0-in-azure-websites-roles-and-virtual-machines/
#
#
# NOTE: This registry change requires that the server be restarted. The script
# will detect if a change is applied and AUTOMATICALLY reboot the server.
# If you don't want automatic reboot comment out the final section of the
# script before running!
Function Ensure-RegKeyExists {
@markthiessen
markthiessen / inlineConfirm.js
Last active August 29, 2015 14:10
AngularJS (+Bootstrap) directive for inline ngClick confirmation
(function () {
'use strict';
angular.module('yourModule').directive('inlineConfirm',
['$compile',
function ($compile) {
return {
priority: -100,
link: function (scope, elm, attrs) {
var wrapperTemplate = '<div class="popover inline-confirm" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>';
var template =
Get-ChildItem . |% {mv $_.name "$([guid]::NewGuid().ToString()+$_.extension)"}

Keybase proof

I hereby claim:

  • I am markthiessen on github.
  • I am markthiessen (https://keybase.io/markthiessen) on keybase.
  • I have a public key ASBLl9NY02UvgDCLeI1iXlgYUVYjpxp9oM_GfNoaT_tQUQo

To claim this, I am signing this object:

@markthiessen
markthiessen / simple-css.css
Created April 21, 2020 14:51
Just some simple css. Nothing to see here.
body {
max-width: 800px;
padding: 20px;
}