Skip to content

Instantly share code, notes, and snippets.

View paul42's full-sized avatar

Paul.42 paul42

View GitHub Profile
@paul42
paul42 / about.svx
Created July 19, 2020 20:28
After adding the --ext '.svelte .svx' to package json:
<svelte:head>
<title>About</title>
</svelte:head>
# markdown heading 1
## markdown heading 2
<h1>About this site</h1>
<p>Hi, I'm Paul, I'm working on teaching myself more front end development with <a href="svelte.dev">Svelte.js</a> and Sapper </p>
@paul42
paul42 / machine.js
Last active May 2, 2020 19:49
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@paul42
paul42 / machine.js
Last active May 2, 2020 19:26
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@paul42
paul42 / gist:7394803a64a3787d97079781df10696c
Created January 25, 2018 20:52 — forked from halyph/gist:5378331
Calculate PDF Table Row Heights with iTextSharp (link) [http://kuujinbo.info/iTextSharp/rowHeights.aspx]
public static float TotalRowHeights(
Document document, PdfContentByte content,
PdfPTable table, params int[] wantedRows)
{
float height = 0f;
ColumnText ct = new ColumnText(content);
// respect current Document.PageSize
ct.SetSimpleColumn(
document.Left, document.Bottom,
document.Right, document.Top
@paul42
paul42 / Test Pipeline Class
Created January 24, 2018 17:29 — forked from jmichas/Test Pipeline Class
This gist illustrates a TPL Dataflow Pipeline that branches and the various ways to propagate completion and why some work and some don't.
public class DataflowTestPipeline
{
public TransformBlock<Thing, Thing> MainBlock { get; set; }
public TransformBlock<Thing, Thing> Block1 { get; set; }
public TransformBlock<Thing, Thing> Block2 { get; set; }
public TransformBlock<Thing, Thing> Block3 { get; set; }
public ActionBlock<Thing> EndBlock { get; set; }
public void CreatePipelineSynchronousWithLinkOptions()
{
@paul42
paul42 / fresh rake build errors
Created March 9, 2015 18:56
fresh rake build errors
X:\>git clone https://github.com/tknerr/bills-kitchen.git
Cloning into 'bills-kitchen'...
remote: Counting objects: 2486, done.
remote: Compressing objects: 100% (15/15), done.
remote: Total 2486 (delta 6), reused 0 (delta 0), pack-reused 2469
Receiving objects: 100% (2486/2486), 6.66 MiB | 10.42 MiB/s, done.
Resolving deltas: 100% (1396/1396), done.
Checking connectivity... done.
X:\>cd bills-kitchen
@paul42
paul42 / path not found errors
Created March 9, 2015 18:26
rake build errors - cannot find path specified
X:\>cd bills-kitchen
X:\bills-kitchen>rake build
checking cache for 'http://github.com/Maximus5/ConEmu/releases/download/v15.03.05/ConEmuPack.150305.7z' cache-hit: read from 'd49a62084eb696b50d985b064b4c73d6'
extracting 'C:/Users/paul42/AppData/Local/Temp/d20150309-11724-16ajlld/ConEmuPack.150305.7z' to 'X:/bills-kitchen/target/build/tools/conemu'
The system cannot find the path specified.
checking cache for 'http://github.com/mridgers/clink/releases/download/0.4.4/clink_0.4.4_setup.exe'
cache-hit: read from 'd23951f7212c2454a8c5ab899810e3b1'
extracting 'C:/Users/paul42/AppData/Local/Temp/d20150309-11724-1q8pmyn/clink_0.4.4_setup.exe' to 'X:/bills-kitchen/target/build/tools/clink'
The system cannot find the path specified.
@paul42
paul42 / rake build via git bash
Created March 9, 2015 18:17
Error from rake build, win7 git bash via conEmu
Installing the 'vagrant-toplevel-cookbooks --version '0.2.4'' plugin. This can take a few minutes...
Installed the plugin 'vagrant-toplevel-cookbooks (0.2.4)'!
Installing the 'vagrant-omnibus --version '1.4.1'' plugin. This can take a few minutes...
Installed the plugin 'vagrant-omnibus (1.4.1)'!
Installing the 'vagrant-cachier --version '1.2.0'' plugin. This can take a few minutes...
Bundler, the underlying system Vagrant uses to install plugins,
reported an error. The error is shown below. These errors are usually
caused by misconfigured plugin installations or transient network
issues. The error from Bundler is:
@paul42
paul42 / rake build errors win7 cmd.exe
Last active August 29, 2015 14:16
error from rake build, win7 cmd.exe with tknerr/ruby-devpack
Failures:
1) bills kitchen tools installs Terraform 0.3.7
Failure/Error: run_cmd("terraform --version").should match('0.3.7')
expected "'terraform' is not recognized as an internal or external command,\noperable program or batch file.\n" to match "0.3.7"
Diff:
@@ -1,2 +1,3 @@
-0.3.7
+'terraform' is not recognized as an internal or external command,
+operable program or batch file.
@paul42
paul42 / default.pp
Created September 2, 2014 03:58
working librarian-puppet build
include nodejs
package { 'express':
ensure=>present,
provider=>'npm',
}
file {"/home/vagrant/tmpStuff":
ensure => "directory"