Skip to content

Instantly share code, notes, and snippets.

@hamano
hamano / README.md
Last active April 9, 2024 09:38
unzip 6.0 日本語化パッチ(Shift_JISファイル名などに対応)
@terrancesnyder
terrancesnyder / regex-japanese.txt
Created November 7, 2011 14:05
Regex for Japanese
Regex for matching ALL Japanese common & uncommon Kanji (4e00 – 9fcf) ~ The Big Kahuna!
([一-龯])
Regex for matching Hirgana or Katakana
([ぁ-んァ-ン])
Regex for matching Non-Hirgana or Non-Katakana
([^ぁ-んァ-ン])
Regex for matching Hirgana or Katakana or basic punctuation (、。’)
@eagletmt
eagletmt / tombloo.service.extractors.Danbooru.js
Created December 23, 2011 13:44
Tombloo extractor for Danbooru
(function() {
Tombloo.Service.extractors.register({
name : 'Photo - Danbooru',
ICON : 'http://danbooru.donmai.us/favicon.ico',
URL : 'http://danbooru.donmai.us/',
check : function(ctx) {
const DANBOORU_LIKE_SITES = [
'://danbooru.donmai.us/post/show/',
'://yande.re/post/show/',
'://konachan.com/post/show/',
<?php
function rgicgier_pagination($query = null) {
if ( !$query ) {
global $wp_query;
$query = $wp_query;
}
$big = 999999999; // need an unlikely integer
$pagination = paginate_links( array(
@hubgit
hubgit / README.md
Last active June 14, 2024 17:40
Remove metadata from a PDF file, using exiftool and qpdf. Note that embedded objects may still contain metadata.

Anonymising PDFs

PDF metadata

Metadata in PDF files can be stored in at least two places:

  • the Info Dictionary, a limited set of key/value pairs
  • XMP packets, which contain RDF statements expressed as XML

PDF files

@Jach
Jach / show_retweets.py
Created September 25, 2014 04:47
Print out all the retweets you made. Download your twitter data backup, go into the data/js/tweets folder and run this script.
import json
import glob
files = glob.glob('*.js')
data = {}
for f in files:
file = open(f)
_ = file.readline()
data[f] = json.loads(file.read())
@loleg
loleg / grab-commons-images-sh
Last active June 3, 2023 09:49
Download images and metadata from a Wikimedia Commons category or results page
#!/bin/bash
#
# Download images from a Wikimedia Commons category
#
# Highest preview resolution and metadata in XML format will be saved in subfolders.
# Usage: execute this script on a Linux command line, providing the full URL to the category page.
#
# Shell tools required for this script: wget sed grep
#
@dyjjones
dyjjones / torrent.py
Created July 6, 2015 03:56
download torrent files
import urllib2
import json
from sys import argv
from bs4 import BeautifulSoup
import StringIO
import gzip
import sh
import zlib
url = "http://metasearch.torrentproject.com/torrenttojson4.php?site=kat.cr&search={}&output=json".format('%20'.join(argv[1:]))
@williballenthin
williballenthin / commands.sh
Last active April 3, 2024 00:50
Install IDA Pro under Wine in Docker
# build wine Docker image
pushd wine; docker build -t wine .; popd
# build x11 Docker image for IDA
pushd ida; docker build -t wine/ida .; popd
# demonstrate x11 forwarding works
docker run -ti --rm -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix wine/ida xclock
# interactive shell in container
2016-02-16 09:05:50 ERROR SEARCHQUEUE-BACKLOG-114801 :: [NyaaTorrents] :: Unknown exception while searching NyaaTorrents. Error: 'Old quality does not match new: 720p BluRay != 720p HDTV : [NIF.Team].Fairy.Tail.236.Sub.ITA.(720p)[9BD4C716]' [820b900]
2016-02-16 09:05:50 DEBUG SEARCHQUEUE-BACKLOG-114801 :: [NyaaTorrents] :: Found result: [KSH-IEA]_Fairy_Tail_-_25_[720p][67469256].mkv with 0 seeders and 1 leechers
2016-02-16 09:05:50 DEBUG SEARCHQUEUE-BACKLOG-114801 :: [NyaaTorrents] :: Found result: [NIF Team] Fairy Tail 256 Sub ITA (1080p)[BDC88B29] with 0 seeders and 0 leechers
2016-02-16 09:05:50 DEBUG SEARCHQUEUE-BACKLOG-114801 :: [NyaaTorrents] :: Found result: [諸神字幕組][妖精的尾巴][Fairy Tail][256][720P][中日雙語字幕][MP4] with 0 seeders and 2 leechers
2016-02-16 09:05:50 DEBUG SEARCHQUEUE-BACKLOG-114801 :: [NyaaTorrents] :: Found result: Fairy Tail - 256 [FlyH] vostfr 400p.mp4 with 0 seeders and 0 leechers
2016-02-16 09:05:50 DEBUG SEARCHQUEUE-BACKLOG-114801 :: [NyaaTorrents] :: Found result: Fairy