Skip to content

Instantly share code, notes, and snippets.

@Spraynard
Spraynard / filterFromObject.js
Last active December 17, 2019 01:38
Tail recursive function to remove specified keys out from object
/**
* Given a array of keys, filter those keys out of target object.
* If the key isn't in the object, that's okay.
*
* Example:
* filterFromObject(['a', 'b', 'c'], { 'a' : true, 'b' : true, 'c' : true, 'd' : true }) => {'d' : true}
* @param {array} keys_to_remove - Keys to remove from our object
* @param {object} target - Object to remove our keys from
*/
export const filterFromObject = ( keys_to_remove, target ) => {
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Media;
...
FileInfo imgInfo = new FileInfo(path_to_img)
// Create rotate transform that will be applied to our image.
RotateTransform transform = new RotateTransform(90); // 90-degree rotation transform.
// Control type
@Spraynard
Spraynard / insertingImageControl_RotatedImage1.cs
Last active February 14, 2019 03:38
Rotate images in a flow document by rotating the control type
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Media;
...
FileInfo imgInfo = new FileInfo(path_to_img)
// Create rotate transform that will be applied to our image.
RotateTransform transform = new RotateTransform(90); // 90-degree rotation transform.
// Control type
@Spraynard
Spraynard / insertingImageControl_Basic.cs
Last active February 14, 2019 03:36
Inserting Image control as a child of BlockUIContainer
using System.Windows.Controls;
using System.Windows.Documents;
...
FileInfo imgInfo = new FileInfo(path_to_img)
// Control type
Image myImage = new Image();
BitmapImage bitmapImg = new BitmapImage();
@Spraynard
Spraynard / ultimate-ut-cheat-sheet.md
Last active February 5, 2018 16:34 — forked from yoavniran/ultimate-ut-cheat-sheet.md
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai and Sinon

The Ultimate Unit Testing Cheat-sheet

For Mocha, Chai and Sinon

using mocha/chai/sinon for node.js unit-tests? check out my utility: mocha-stirrer to easily reuse test components and mock require dependencies