This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<style> | |
.mask-elem { position: absolute; opacity: 0.1; z-index: -1; background: blue; } | |
.mask-node { position: absolute; opacity: 0.3; z-index: -1; background: green; } | |
.mask-char { position: absolute; opacity: 0.5; z-index: -1; background: red; } | |
</style> | |
<body> | |
<p> | |
Lorem ipsum dolor sit amet, <b>consectetur</b> adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. <i>Ut</i> enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<style> | |
div{ width: 100px; font-family: Verdana; } | |
</style> | |
<body> | |
<div> | |
wbr:aaaaaaaa<wbr>aaaaaaaaa<br><br> | |
zwsp:aaaaaaaa​aaaaaaaaa<br><br> | |
zwnj:aaaaaaaa‌aaaaaaaaa<br><br> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name 画面上のツイートをテキストでコピー | |
// @namespace https://github.com/unarist/ | |
// @version 0.1 | |
// @author unarist | |
// @match https://twitter.com/* | |
// @exclude https://twitter.com/i/* | |
// @grant GM_registerMenuCommand | |
// ==/UserScript== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 参考: http://lifeinhex.com/how-to-inject-byte-array-using-dnlib/ | |
var asm = AssemblyDefinition.ReadAssembly("target.exe"); | |
var data = File.ReadAllBytes("in.dat"); | |
// 適当な型に、(ここではコンパイラと同じ名前を使うので競合に注意) | |
var cls = new TypeDefinition("", "<PrivateImplementationDetails>", Mono.Cecil.TypeAttributes.Sealed, asm.MainModule.TypeSystem.Object); | |
asm.MainModule.Types.Add(cls); | |
// a. 目的のサイズの構造体(メンバはなくてよい) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Action<T> GetAssignMethod<T>(string field, object value) | |
{ | |
var arg = Expression.Parameter(typeof(T)); | |
var body = Expression.Assign(Expression.Field(arg, field), Expression.Constant(value)); | |
return (Action<T>)Expression.Lambda(typeof(Action<T>), body, arg).Compile(); | |
} | |
void MoveItems<T>(ICollection<T> src, ICollection<T> dest, Func<T,bool> filter = null) | |
{ | |
var items = filter != null ? src.Where(filter).ToList() : src.ToList(); | |
items.ForEach(x => { src.Remove(x); dest.Add(x); }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// #r "FSharp.Compiler.Services.dll" | |
// #r "FSharpVSPowerTools.Core.dll" | |
open Microsoft.FSharp.Compiler.SourceCodeServices | |
open FSharpVSPowerTools.CodeGeneration.SignatureGenerator | |
System.Diagnostics.Trace.Listeners.Clear() | |
let checker = FSharpChecker.Create() | |
let tempfile = Path.ChangeExtension(Path.GetTempFileName(), "fs") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name MDNで翻訳するときの自動処理 | |
// @namespace https://github.com/unarist/ | |
// @downloadURL https://gist.github.com/unarist/641014d0836cea842690b8f3a20b44f9/raw | |
// @version 0.1 | |
// @author unarist | |
// @match https://developer.mozilla.org/*/docs/* | |
// ==/UserScript== | |
(function() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void Main() | |
{ | |
// Write code to test your extensions here. Press F5 to compile and run. | |
} | |
public static class Ex | |
{ | |
public static string CallerMemberName([CallerMemberName]string member = "") => member; | |
public static Func<TR> F<TR>(Func<TR> f) { return f; } | |
public static Func<T, TR> F<T, TR>(Func<T, TR> f) { return f; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Hatena::Let - Show diff for forking | |
// @namespace https://github.com/unarist/ | |
// @version 0.4.1 | |
// @author unarist | |
// @downloadURL https://gist.github.com/unarist/e7ee9237764cc5cd2a3b4a531db8b5ee/raw/let-diff.user.js | |
// @match https://let.hatelabo.jp/*/let/* | |
// @require https://cdnjs.cloudflare.com/ajax/libs/jsdiff/3.4.0/diff.min.js#sha256=mXHDe/99FPqL1QnYUVFKhAAl45/l91tGCpRNkr4s9Mg= | |
// @grant none | |
// ==/UserScript== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Mastodon - Preview local TL | |
// @description Add "Preview local TL" to bottom of signup form. | |
// @namespace https://github.com/unarist/ | |
// @version 0.10 | |
// @author unarist | |
// @license MIT license | |
// @match https://*/about | |
// @require https://cdnjs.cloudflare.com/ajax/libs/jade/1.11.0/jade.min.js | |
// @downloadURL https://gist.github.com/unarist/6d06ad73945b5a369f6d593b1a2cfba8/raw/mastodon-preview-local-tl.user.js |