This file contains 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
const DEPTH = 2; // 1 is usless, 3 is insane | |
const PROFILE_RE = /profile\/(.*?)(?:\/|$)/; | |
const SELF_PROFILE_RE = /profile\/(.*?)\/friends/; | |
const PROFILE_URL = 'https://myanimelist.net/profile/{profile}'; | |
const FRIENDS_URL = 'https://myanimelist.net/profile/{profile}/friends'; | |
function promiseWhile(condition, action) { | |
return new Promise((resolve, reject) => { | |
function loop() { | |
if (!condition()) { |
This file contains 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== | |
// @version 1.0 | |
// @name Pixiv Top | |
// @description Load 7 pages and order it by bookmarks count | |
// @match *://www.pixiv.net/search.php* | |
// @grant none | |
// @require https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.1/jquery.min.js | |
// @require https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.13.0/moment.min.js | |
// @require https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.15.0/lodash.min.js | |
// ==/UserScript== |
This file contains 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
<?php | |
/** | |
* Formats a number as a ruble currency string for web. | |
* | |
* @param float $number The number to be formatted. | |
* @param int $decimals [optional] | |
* @param boolean $trim_zero_decimals [optional] | |
* @param boolean $add_currency_suffix [optional] | |
* @return string A formatted version of number. |
This file contains 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
import os | |
import json | |
import time | |
from struct import unpack_from | |
from datetime import datetime | |
import usb.core | |
import usb.backend.libusb1 | |
This file contains 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 MAL Season Friends Watching | |
// @version 1.0 | |
// @match http://myanimelist.net/anime/season | |
// @grant none | |
// @require https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.1/jquery.min.js | |
// @require https://cdn.rawgit.com/patik/within-viewport/1.0.0/withinviewport.js | |
// @require https://cdn.rawgit.com/patik/within-viewport/1.0.0/jquery.withinviewport.js | |
// @require https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js | |
// ==/UserScript== |
This file contains 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
#!/bin/bash | |
# | |
# this script should not be run directly, | |
# instead you need to source it from your .bashrc, | |
# by adding this line: | |
# . ~/bin/cdr.sh | |
# | |
function cdr() { | |
replacement=$1 | |
array=(${PWD//\// }) |
This file contains 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
<?php | |
$access_token = ""; | |
if (empty($_COOKIE["access_token"]) || $_COOKIE["access_token"] !== $access_token) { | |
header('HTTP/1.0 404 Not Found'); | |
echo "<h1>404 Not Found</h1>"; | |
echo "The page that you have requested could not be found."; | |
die(); | |
} else { | |
header('Connection: close'); | |
header('X-Accel-Buffering: no'); |
This file contains 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
git ls-files | sort -f | uniq -cid | wc -l |
This file contains 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
$(window).load(function(){ | |
var live_selectors = []; | |
$($._data(document, 'events').click).each(function(){ | |
live_selectors.push(this.selector); | |
}); | |
$('a[href=""], a[href^="#"]').each(function(){ | |
var link = this; | |
if (this.onclick === null && |
This file contains 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
# -*- coding: utf-8 -*- | |
""" | |
Usage: | |
python album_fetcher.py https://plus.google.com/photos/118353143366443526186/albums/5626152497309725217 | |
python album_fetcher.py https://plus.google.com/118353143366443526186 | |
python album_fetcher.py https://plus.google.com/118353143366443526186 youremail@gmail.com yourpassword | |
python album_fetcher.py https://plus.google.com/118353143366443526186 youremail@gmail.com yourpassword /out_dir/ | |
TODO: use opt parse | |
""" | |
import os |