Skip to content

Instantly share code, notes, and snippets.

using System;
using System.Diagnostics;
using System.IO;
using System.Text;
using System.Reflection;
using System.Linq;
namespace ActionLib.Utils
{
/// <summary>
javascript:(function() { var count = 0, text1, text2, regexp1, regexp2; text1 = "^.*error.*$"; text2 = "(/|\\\\)\\w+\\.(cs|js|as|py).*error"; regexp1 = new RegExp("(" + text1 + ")", "i"); regexp2 = new RegExp("(" + text2 + ")", "i"); function searchWithinNode(node, re, color) { var pos, skip, spannode, middlebit, endbit, middleclone; skip = 0; if (node.nodeType == 3) { pos = node.data.search(re); if (pos >= 0) { spannode = document.createElement("SPAN"); spannode.style.backgroundColor = color; middlebit = node.splitText(pos); endbit = middlebit.splitText(RegExp.$1.length); middleclone = middlebit.cloneNode(true); spannode.appendChild(middleclone); middlebit.parentNode.replaceChild(spannode, middlebit); ++count; skip = 1; } } else if (node.nodeType == 1 && node.childNodes && node.tagName.toUpperCase() != "SCRIPT" && node.tagName.toUpperCase != "STYLE") { for (var child = 0; child < node.childNodes.length; ++child) { child = child + searchWithinNode(node.childNodes[child], re, color); } } return skip; } searchW
javascript:(function() { var count = 0, text1, text2, regexp1, regexp2; text1 = "^.*error.*$"; text2 = "(/|\\\\)\\w+\\.(cs|js|as|py).*error"; regexp1 = new RegExp("(" + text1 + ")", "i"); regexp2 = new RegExp("(" + text2 + ")", "i"); function searchWithinNode(node, re, color) { var pos, skip, spannode, middlebit, endbit, middleclone; skip = 0; if (node.nodeType == 3) { pos = node.data.search(re); if (pos >= 0) { spannode = document.createElement("SPAN"); spannode.style.backgroundColor = color; middlebit = node.splitText(pos); endbit = middlebit.splitText(RegExp.$1.length); middleclone = middlebit.cloneNode(true); spannode.appendChild(middleclone); middlebit.parentNode.replaceChild(spannode, middlebit); ++count; skip = 1; } } else if (node.nodeType == 1 && node.childNodes && node.tagName.toUpperCase() != "SCRIPT" && node.tagName.toUpperCase != "STYLE") { for (var child = 0; child < node.childNodes.length; ++child) { child = child + searchWithinNode(node.childNodes[child], re, color); } } return skip; } searchW
@canab
canab / gist:5055580
Last active December 14, 2015 08:09
public class CustomComponent : Component
{
DelayActivity delay = new DelayActivity(duration: 3000);
TimerActivity timer = new TimerActivity(period: 3000, ticksCount: 2);
enum RocketState { S1, S1 };
RocketState state;
public CustomComponent()
{
public static void create2DMatrix(ref Vector2 scale, float rotation, ref Vector2 translation,
out Matrix result)
{
if (rotation == 0)
{
result.M11 = scale.X;
result.M12 = 0;
result.M21 = 0;
result.M22 = scale.Y;
Декомпозируя пространство компонентов на несколько ортогональных измерений, можно уменьшить число компонентов, и, что более важно, предоставить концептуальную основу того, как проектировать что-либо.
@canab
canab / gist:4611691
Last active December 11, 2015 14:08
status
декомпозируя пространство компонентов на несколько ортогональных измерений, мы можем уменьшить число компонентов, и, что более важно, мы можем предоставить концептуальную основу того, как проектировать что-либо.
http://24.media.tumblr.com/77c165b8495007297930d2c05b327223/tumblr_mhtfp33pzi1rzh6ewo1_400.jpg
12 відбивних: 12385678abcd
(0) - не просмажені
(1) - просмажені з одної сторони
(2) - готові
-----------------------------------------
хв. сковорідка решта пояснення
-----------------------------------------
0 1234(0) 5678(0) abcd(0) викладаємо 8 шт
4 1234(1) abcd(0) 5678(1) 1234 перевертаємо, 5678 замінюємо на abcd
// Type: System.MulticastDelegate
// Assembly: mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
// Assembly location: C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll
using System.Diagnostics;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
// Type: System.Delegate
// Assembly: mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
// Assembly location: C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll
using System.Globalization;
using System.Reflection;
using System.Runtime;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;