Skip to content

Instantly share code, notes, and snippets.

@dander
dander / DetectUpgrade.wxi
Created January 13, 2014 21:20
Upgrade detection properties for WiX (not tested but looks like a handy thing to have). I'm actually thinking this might make more sense in a Fragment instead of Include. based on: http://code.dblock.org/msi-property-patterns-upgrading-firstinstall-and-maintenance#comment-695361597
<?xml version="1.0" encoding="utf-8"?>
<Include xmlns="http://schemas.microsoft.com/wix/2006/wi">
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." Schedule="afterInstallInitialize"/>
<SetProperty Id="FirstInstall" After="FindRelatedProducts" Value="true">
NOT Installed AND NOT WIX_UPGRADE_DETECTED AND NOT WIX_DOWNGRADE_DETECTED
</SetProperty>
<SetProperty Id="Upgrading" After="SetFirstInstall" Value="true">
WIX_UPGRADE_DETECTED AND NOT (REMOVE="ALL")
@dander
dander / signtool.msbuild.tasks
Last active September 23, 2015 21:10 — forked from gregmac/signtool.msbuild.tasks
SignTool MSBuild Task
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--
Sign .exe files using signtool.exe.
(c) 2014 Greg MacLellan, Licensed under MIT http://opensource.org/licenses/MIT
Features:
* Hides password from being displayed in build output
* Retries against multiple timestamp servers if the server returns an invalid response (fairly common)
<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" media="screen" href="/styles/xslt/rss.xslt"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:c9="http://channel9.msdn.com">
<channel>
<title>The Defrag Show (Audio) - Channel 9</title>
<atom:link rel="self" type="application/rss+xml" href="https://channel9.msdn.com/Shows/The-Defrag-Show/feed/mp3"></atom:link>
<itunes:summary>Channel 9&#39;s tech support and troubleshooting show hosted by Larry Larsen and Gov Maharaj. Send your questions to DefragShow@Microsoft.com. </itunes:summary>
<itunes:author>Microsoft</itunes:author>
<itunes:subtitle></itunes:subtitle>
<image>
@dander
dander / parse-crashplan-csv.cs
Created November 10, 2016 07:41
search crashplan manifest (can be run in LINQPad in C# program mode)
void Main()
{
var result = ReadLines(@"D:\temp\crashplan\full-dump3.csv")
// faster initial tests...
// .Skip(1)
// .Take(10)
.Select(l => l.Split(','))
// extract properties of each csv row
.Select(l => new
{
@dander
dander / redLib.linq
Created February 17, 2017 09:10
LINQPad "hello libRed" script
<Query Kind="Program">
<Reference>&lt;RuntimeDirectory&gt;\System.Runtime.InteropServices.dll</Reference>
<Namespace>System.Runtime.InteropServices</Namespace>
</Query>
void Main()
{
redOpen();
redDo("view [text {hello, libRed!}]");
}
@dander
dander / range-generator.red
Created April 26, 2017 06:04
lazy range enumeration
Red [
Title: "range generator attempt (4?)"
]
; @JacobGood's closure func
closure: func [
vars [block!]
spec [block!]
body [block!]
][
@dander
dander / generators.red
Last active August 27, 2020 07:29
An experiment to make a general purpose generator-creating function
Red [
Title: "generator function experiments"
Author: "Dave Andersen"
Date: 27-Sep-2017
]
reload: does [do system/options/script]
; @JacobGood's closure func
closure1: func [
@dander
dander / profile.red
Created November 14, 2017 06:21 — forked from greggirwin/profile.red
Basic profiling for Red code comparisons
Red []
e.g.: :comment
delta-time: function [
"Return the time it takes to evaluate a block"
block [block! word! function!] "Block to evaluate"
/count ct "Eval the block this many times, rather than once"
][
ct: any [ct 1]
@dander
dander / Macros.md
Created February 8, 2018 21:18
JacobGood1's macros page

Macros(SPEL:-semantic-programming-enhancement-logic).md First of all, I advocate we call macros SPELs in order to get rid of the confusion when people come from other languages. This will also allow people who want to write tutorials about such a feature to easily(or more easily) google the word SPEL over macro. My recommendation of SPEL is not my own idea it comes from Conrad Barski: http://www.lisperati.com/no_macros.html

Shen, a dialect of lisp, will be what is used for spel examples. I will try to explain the syntax in order for readers of this wiki to be able to absorb the idea of spels. Come to this channel for questions, comments, approvals, disapprovals, or whatever else: https://gitter.im/red/red/lisp

We will begin(and end) by discussing two examples: max and thread.

In Shen, one defines a function at the repl like so...

@dander
dander / Words-and-Bindings.md
Created September 10, 2018 23:41
Attempting to produce a simple / concise explanation of words in Red

What are words?

Words form the grammar of the Red programming language. For people familiar with more mainstream languages, word! replaces keywords, variables, and operators. However, unlike other programming languages where those constructs have fixed definitions hard-wired in the compiler, in Red words are just a basic type of data. This makes the structure of a program extremely flexible.

Parts of a word!

A word! is made of up of 3 basic parts.

  • name - The symbolic representation of the word. It's just the text that you typed to create the word
  • context - This determines the meaning of the word. Just as in spoken language, a word can change its meaning depending on the context. In Red, a context is a mapping of words to their meanings.