Skip to content

Instantly share code, notes, and snippets.

View ngs's full-sized avatar
🎣
Fly Fishing

Atsushi NAGASE ngs

🎣
Fly Fishing
View GitHub Profile
@ngs
ngs / map.geojson
Last active April 15, 2025 20:52
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<?php
$str = "=?UTF-8?B?44GC44GE44GG44GI44GK44GC44GE44GG44GI44GK44GC44GE44GG44GI44GK?=";
$ar = explode("?", $str);
$encoded = $ar[3];
$decoded = base64_decode($encoded);
echo $decoded;
?>
document.getElementById('lottie').addEventListener('click', e => {
const elements = [].concat.apply([], anim.projectInterface.compositions.map(e => e.elements));
const baseElements = elements.map(elm => elm.baseElement);
let element = e.target;
let found = null;
while(element && /^(g|path)$/.test(element.nodeName)) {
let idx = baseElements.indexOf(element);
if (idx !== -1) {
found = elements[idx];
break;
@ngs
ngs / setup.sh
Last active March 9, 2019 01:05
brew install v8-315
bundle config --local build.libv8 --with-system-v8
bundle config —local build.charlock_holmes --with-cppflags=-DU_USING_ICU_NAMESPACE=1 --with-cxxflags=-std=c++11
bundle config --local build.therubyracer --with-v8-dir=$(brew --prefix v8-315)
@ngs
ngs / decl.js
Last active January 8, 2023 15:49
[].slice.call(document.querySelectorAll('#content > div.fixedFont'), 0).map(function(i, n){
const text = i.innerText;
let desc = i.nextSibling;
while(desc && desc.className !== 'description') {
desc = desc.nextSibling;
}
const m = text.match(/\{([^\}]+)\}\s(.+)$/) || ['', 'void', text];
const retType = m[1];
const fn = m[2];
return '/**\n * ' + desc.innerText.replace(/\n/g, '\n * ') + '\n */\n' + fn + ': ' + retType + ';';
@ngs
ngs / fill-quotes.js
Created February 27, 2019 20:09
Auto fill MoneyForward quotes
let unitPrice = ...;
let subjects = `...`.split(/\n/g);
let quantities = `...`.split(/\n/g)
while($('.js-css-item-row').size() < subjects.length + 1) {
$('#js-add-item').click()
$('.js-css-item-row:last #quote_quote_items_attributes__unit_price').val(unitPrice)
}
subjects.forEach((s, i) => $(`.js-css-item-row:eq(${i}) #quote_quote_items_attributes__name`).val(s))
@ngs
ngs / index.js
Last active February 19, 2019 15:38
Verify License
const crypto = require('crypto');
const https = require('https');
const { parseString } = require('./xml2js/xml2js');
exports.handler = (event, context, callback) => {
let { token } = event;
let buf = Buffer.from(token, 'base64');
let xml = buf.toString().replace(/\u0000/g, '');
https.get('https://verificationservice.officeapps.live.com/ova/verificationagent.svc/rest/verify?token=' + encodeURIComponent(xml), (resp) => {
Alt(右)           E038
Alt(左)           38
Ctrl(右)          E01D
Ctrl(左)          1D
Shift(右)         36
Shift(左)         2A
Win(右)           E05C
Win(左)           E05B
Application       E05D
btoa([].slice.call(window.crypto.getRandomValues(new Uint8Array(4096))).map((n) => String.fromCharCode(n)).join(''))
@ngs
ngs / allCSS.js
Last active January 8, 2023 15:48
// https://developer.mozilla.org/en-US/docs/Web/API/StyleSheetList
var allCSS =
[].slice.call(document.styleSheets)
.reduce(function (prev, styleSheet) {
try {
return prev +
[].slice.call(styleSheet.cssRules)
.reduce(function (prev, cssRule) {
return prev + cssRule.cssText;