Skip to content

Instantly share code, notes, and snippets.

View hiroshil's full-sized avatar
💭
I may be slow to respond.

Hiroshi hiroshil

💭
I may be slow to respond.
View GitHub Profile
@hiroshil
hiroshil / n210-dl.user.js
Last active April 27, 2024 10:36
Script to download manga on some domain of nhentai into a zip file (Note: Requires "Allow CORS" extension with "Access-Control-Allow-Origin" mode set to "*" in options page for script to work)
// ==UserScript==
// @name n210-dl
// @namespace https://gist.github.com/hiroshil
// @version 0.1.1
// @description Script used to download manga R18 on some domain of nhentai
// @license MIT
// @author hiroshil
// @source https://gist.github.com/hiroshil/86723bc557efa88931cf6b135e42a2b2
// @match http*://nhentai.to/g/*
// @match http*://nhentai.xxx/g/*
@hiroshil
hiroshil / 210vn-dl.user.js
Last active August 10, 2024 15:00
Script download manga trên 1 domain của hentaivn thành một file zip (Lưu ý: cần cài thêm extension "Allow CORS" và bật chế độ "Access-Control-Allow-Origin" từ "ORIGIN" sang "*" trong trang tùy chọn để script có thể hoạt động)
// ==UserScript==
// @name 210vn-dl
// @namespace https://gist.github.com/hiroshil
// @version 0.0.6
// @description Script dùng để download manga R18 trên 1 domain của hentaivn
// @license MIT
// @author hiroshil
// @source https://gist.github.com/hiroshil/b85af14867493a72bd1cb24831bf0668
// @include http*://*.*/*doc-truyen*
// @icon https://www.google.com/s2/favicons?sz=64&domain=hentaivn.icu
@hiroshil
hiroshil / tmo-dl.user.js
Last active January 31, 2024 17:21
Script to download manga from TuMangaOnline into a zip file (Note: Requires "Allow CORS" extension with "Access-Control-Allow-Origin" mode set to "*" in options page for script to work). This script was created in my free time and may not be updated regularly.
// ==UserScript==
// @name tmo-dl
// @namespace https://gist.github.com/hiroshil
// @version 1.0
// @description Script to download manga from TuMangaOnline
// @license MIT
// @author hiroshil
// @match https://visortmo.com/library/manga/*/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=visortmo.com
// @downloadURL https://gist.github.com/hiroshil/6c4360a56dd37a788646c468fe2ef7fc/raw/3fb7e6fde2dabe3fb4198eda17cce25db89c9dfa/tmo-dl.user.js
@hiroshil
hiroshil / viewimage.user.js
Last active October 18, 2023 16:54 — forked from bijij/viewimage.user.js
Userscript version of the View Image chrome extension
// ==UserScript==
// @name View Image
// @namespace https://github.com/bijij/ViewImage
// @version 4.1.1
// @description This userscript re-implements the "View Image" and "Search by image" buttons into google images.
// @author Joshua B
// @run-at document-end
// @include http*://*.google.com/search*tbm=isch*
// @include http*://*.google.com/imgres*
// @updateURL https://gist.github.com/hiroshil/857bb19163ebfe02134c5ab5fa2cd5e7/raw/viewimage.user.js
@hiroshil
hiroshil / list-fftabs.js
Last active December 7, 2021 05:03 — forked from tmonjalo/list-fftabs.py
List all Firefox tabs with title and URL
var path = require("path");
var globule = require('globule');
var jsonlz4 = require('jsonlz4-decompress');
var fs = require('fs');
function getTabs() {
var fpath;
if (process.platform == "darwin") {
fpath = path.join(process.env.HOME, 'Library/Preferences');
} else if (process.platform == "win32" || process.platform == "win64") {
@hiroshil
hiroshil / README.md
Created December 4, 2021 16:10 — forked from pbojinov/README.md
Two way iframe communication- Check out working example here: http://pbojinov.github.io/iframe-communication/

Two way iframe communication

The main difference between the two pages is the method of sending messages. Recieving messages is the same in both.

Parent

Send messages to iframe using iframeEl.contentWindow.postMessage Recieve messages using window.addEventListener('message')

iframe

@hiroshil
hiroshil / Usage Note
Created December 4, 2021 13:22 — forked from shoaibmalik786/Usage Note
File upload using ajax
Usage Note:
-----------
// Just put this file in assets/javascripts and require it in application.js
// call function ajaxForm() on id of form containing file while submitting.
Do not use both ajaxSubmit and ajaxForm on the same form. These
functions are mutually exclusive. Use ajaxSubmit if you want
to bind your own submit handler to the form. For example,
@hiroshil
hiroshil / patch.sh
Last active December 3, 2021 01:50 — forked from rufoa/patch.sh
sublime merge 2 build 2063 linux
#!/bin/bash
set -o errexit
set -o nounset
set -o pipefail
target="${1:-/opt/sublime_merge/sublime_merge}"
check_sha() {
local sha_valid
@hiroshil
hiroshil / gist:8776db2c5ba9ab0475ff7fdfadb6e5b6
Created July 29, 2020 15:11 — forked from xsleonard/gist:7341172
hex string to byte array, C
unsigned char* hexstr_to_char(const char* hexstr)
{
size_t len = strlen(hexstr);
IF_ASSERT(len % 2 != 0)
return NULL;
size_t final_len = len / 2;
unsigned char* chrs = (unsigned char*)malloc((final_len+1) * sizeof(*chrs));
for (size_t i=0, j=0; j<final_len; i+=2, j++)
chrs[j] = (hexstr[i] % 32 + 9) % 25 * 16 + (hexstr[i+1] % 32 + 9) % 25;
chrs[final_len] = '\0';