Skip to content

Instantly share code, notes, and snippets.

zaus

Block or report user

Report or block zaus

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@zaus
zaus / =ChromeDevToolsSnippets.md
Last active Aug 6, 2016
Chrome DevTools Snippets (because it doesn't save when you clear your user data...)
View =ChromeDevToolsSnippets.md
View PGPEncryptDecrypt.cs
/// <summary>
/// PGP round-trip encryption -- http://blogs.microsoft.co.il/kim/2009/01/23/pgp-zip-encrypted-files-with-c/#comment-611002
/// </summary>
public class PGPEncryptDecrypt
{
/**
* A simple routine that opens a key ring file and loads the first available key suitable for
* encryption.
*
* @param in
@zaus
zaus / WpPluginUpgradeBase.php
Last active Jun 14, 2017
Wordpress Activation/Upgrade Hook Helper
View WpPluginUpgradeBase.php
<?php
if(!class_exists('WpPluginUpgradeBase')) :
abstract class WpPluginUpgradeBase {
function __construct() {
add_action( 'admin_init', array(&$this, 'load_plugin') );
}
@zaus
zaus / F1-Main.cs
Last active Aug 29, 2015
Partitioning performance comparisons -- via http://stackoverflow.com/a/13745058/1037948. Essentially runs each scenario 10000 times wrapped in a timer and compares the elapsed times.
View F1-Main.cs
void Main()
{
test(100, 9);
test(1000, 9);
test(100, 25);
test(10000, 100);
}
// Define other methods and classes here
void test(int populationSize, int segmentSize) {
@zaus
zaus / copied-js.md
Last active Aug 29, 2015
Testing Syntax Highlighting Error
View copied-js.md

// Disable Context Menu document.oncontextmenu = function () { return false };

// Disable dragging of HTML elements document.ondragstart = function () { return false };

@zaus
zaus / forms-3rdparty-migrate.php
Last active Aug 29, 2015
Forms-3rdparty Migrate Hack -- quick "plugin" to upgrade from CF7-3rdparty to http://wordpress.org/plugins/forms-3rdparty-integration/, or migrate settings across sites.
View forms-3rdparty-migrate.php
<?php
/*
Plugin Name: Forms: 3rd-Party Migrate
Plugin URI: https://github.com/zaus/forms-3rdparty-migrate
Description: Export/Import settings for Forms-3rdparty, or migrate to/from CF7-3rdparty
Author: zaus
Version: 0.3.2
Author URI: http://drzaus.com
*/
View Flat-UI-Color-Swatch-Generator.markdown
@zaus
zaus / LinqPad.MyExtensions.cs
Last active Dec 14, 2018
Linqpad Extensions - `.Title()`, `.DumpFormat(tokens)`, `.Perf(task)`, `.Vs(tasks)`
View LinqPad.MyExtensions.cs
/// <summary>Silly convenience initializer for creating Vs tasks with a dictionary;
/// can use <code>new Perf { { "task1", n => whatever }, {"task2", n => bar}...}.Vs()</code>
/// <para>see http://stackoverflow.com/a/14000325/1037948 </para>
/// </summary>
/// <remarks>Doesn't automatically call <see cref="Vs"/> because...</remarks>
public class Perf : Dictionary<string, Action<int>> {}
/// <summary>Silly convenience initializer for creating Vs tasks with a dictionary that can also provides some output;
/// can use <code>new Perf&lt;T&gt; { { "task1", n => whatever }, {"task2", n => bar}...}.Vs()</code>
/// <para>see http://stackoverflow.com/a/14000325/1037948 </para>
@zaus
zaus / Random-Maze-Generator.markdown
Created Dec 18, 2013
A Pen by Gabriel Valfridsson.
View Random-Maze-Generator.markdown

Random Maze Generator

Generating a maze with a simple algorithm

  1. Find available directions
  2. pick one at random
  3. if no available directions, backtrack to last position loop step 1 to 3 until back at start location

A Pen by Gabriel Valfridsson on CodePen.

View Platform-game-engine.markdown

Platform game engine

A simple platform game engine, the map is customisable and scriptable. Refer to the comments in the "map" variable for instructions.

I plan to expand the engine in the future, the ability to use images for tiles and the player is one thing that I have in mind. Any suggestions are welcome.

A Pen by suffick on CodePen.

License.

You can’t perform that action at this time.