Skip to content

Instantly share code, notes, and snippets.

@cpriest
cpriest / lorem ipsum test.txt
Created October 19, 2012 12:26
Lorem Ipsum Test
Orginal Text in Latein, Deutsch und Englisch
Latein
"De finibus bonorum et malorum" Cicero
Absatz 1.10.32 - 1.10.33
Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?
Test
@cpriest
cpriest / gist:4420904
Last active December 10, 2015 10:28
Alternative to parent::$foo, rather than using that syntax, since accessors shadow properties, we could use $this->foo which would either access the property directly or call the parent foo accessor until there was no parent accessor which $this->foo would then access the property directly.
class A {
public $foo {
get { return $this->foo ?: 'unknown'; }
set { $this->foo = $value; }
}
}
class B extends A {
public $foo {
get { return $this->foo ?: 'unknown'; }
@cpriest
cpriest / gist:4463107
Created January 5, 2013 19:02
Description of current accessors guarding
<?php
class a {
public $Foo {
get { echo 'G '; return $this->Foo; }
set { echo 'S '; $this->Foo = $value; }
isset { echo 'I '; return isset($this->Foo); }
unset { echo 'U '; unset($this->Foo); }
}
}
@cpriest
cpriest / gist:106d11863695d1a31fd3
Created May 9, 2015 13:51
Problem with pThreads
<?php
define('INDEXER_THREADS', 2);
define('READER_THREADS', 2);
define('START_DIR', 'r:/big');
define('READ_SIZE', 1024);
/**
* Executor
@cpriest
cpriest / plugin-psl.md
Last active January 21, 2017 16:29
The way hain-plugin-psl works...

From the start I knew what I wanted to build and the built-in preferences system was too limited to express the configuration, so I decided to go with json5.

It is split into two notions, the first is a pattern. Patterns were the first notion in the project and were a simple way to specify a regular expression pattern and what it would result in.

This is a sample for an npmjs.com search:

{

For lack of a better location for questions/thoughts besides tickets I thought I'd put this gist together:

Questions

  1. For EntriesAdd, shouldn't the id be unique to that plugin?
@cpriest
cpriest / Output
Created November 12, 2018 02:41
Issue trying to use webpack with import using a CDN URL.
> webpack --mode development
C:\code\node\ace-xterm>webpack --mode development
Hash: e76f245f37f70a4d68eb
Version: webpack 4.25.1
Time: 172ms
Built at: 11/11/2018 8:29:54 PM
Asset Size Chunks Chunk Names
main.js 21.8 KiB main [emitted] main
Entrypoint main = main.js
@cpriest
cpriest / Awesome-List.md
Created December 29, 2018 02:14
Just my own list of stuff to keep track of, things I find cool/awesome or to check out
@cpriest
cpriest / ssh-wsl.ahk
Created April 8, 2021 18:22
Command wrapper for PowerShell/OpenSSH to allow for ssh remote commands to work properly by unwrapping $0
;@Ahk2Exe-ConsoleApp
SendMode Input
SetWorkingDir, %A_ScriptDir%
; This script exists because remote ssh command calls when passed to OpenSSH for Windows (PowerShell/OpenSSH)
; The remote command is wrapped in quotes which does not work correctly. This simply unwraps them and passes
; to wsl.exe. ssh {host} echo 'hello world' = wsl.exe "echo 'hello world'"
; This script changes that to: wsl.exe echo 'hello world'
;
@cpriest
cpriest / right-click.ahk
Created May 28, 2021 21:12
Right click script for various uses.
; Globals
#MaxHotkeysPerInterval 500
#NoEnv
; #MenuMaskKey vk07 ; vk07 is unassigned.
#InstallKeybdHook
#UseHook
#SingleInstance Force
SendMode Input
SetWorkingDir, %A_ScriptDir%