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
"use strict"; | |
const {WebClient} = require("@slack/web-api"); | |
const fs = require("fs").promises; | |
const web = new WebClient("xoxp-XXXXXXXXXXXXXX"); | |
(async () => { | |
while(true){ | |
const cursor = JSON.parse(await fs.readFile("cursor.json").catch(() => "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
"use strict"; | |
const iconv = require("iconv-lite"); | |
const fetch = require("node-fetch"); | |
const cheerio = require("cheerio"); | |
(async () => { | |
const contents = []; | |
for(let i = 1; i <= 246; i++){ |
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 | |
class SimpleClient { | |
private $cookies = []; | |
public function get($url){ | |
return $this->request("GET", $url, null); | |
} | |
public function post($url, $param){ | |
return $this->request("POST", $url, $param); | |
} |
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
use strict; | |
# MT19937 | |
my $w = 32; | |
my $n = 624; | |
my $m = 397; | |
my $r = 31; | |
my $u = 11; | |
my $s = 7; | |
my $t = 15; |
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
openssl genrsa 2048 > key.pem | |
openssl req -new -key key.pem > req.pem | |
openssl x509 -days 65536 -req -signkey key.pem < req.pem > cert.pem |
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 | |
$db = new PDO("sqlite:deka.db"); | |
$account = [[], [], [], []]; | |
foreach($db->query("SELECT * FROM Account")->fetchAll(PDO::FETCH_ASSOC) as $deka){ | |
$account[strlen($deka["ID"]) - 5][] = $deka; | |
} | |
foreach($account as &$e){ | |
sort($e); | |
} |
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 | |
$url = $_SERVER["QUERY_STRING"]; | |
if(preg_match("@^http://(.+?)\.(.+?)/@", $url, $m)){ | |
if($m[1] === "www" && $m[2] === "nicovideo.jp"){ | |
header("HTTP/1.1 301 Moved Permanently"); | |
header("Location: {$url}"); | |
}else if($m[2] === "nicovideo.jp" || $m[2] === "nimg.jp" || $m[2] === "smilevideo.jp"){ | |
$hash = md5($url); | |
if(file_exists("{$hash}.content") && file_exists("{$hash}.type")){ | |
$content = file_get_contents("{$hash}.content"); |
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
<!DOCTYPE html> | |
<html lang="ja"> | |
<head> | |
<meta charset="UTF-8"> | |
<style> | |
* { | |
margin: 0; | |
padding: 0; | |
} | |
#container { |
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
var fs = require("fs"); | |
var page = require("webpage").create(); | |
page.open("http://www.adventar.org/calendars/1183", function(){ | |
page.clipRect = page.evaluate(function(){ | |
return document.querySelector(".mod-calendar").getBoundingClientRect(); | |
}); | |
fs.remove("calendar.png"); | |
page.render("calendar.png"); | |
phantom.exit(); | |
}); |
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
(function(a){a("a[univ_id=7]").on("click",function(){a.cookie("gd",parseInt(new Date/1E3));a.cookie("gsu","12",{path:"/"});a.cookie("gsuh","012d30347a0b1899d07967b2c9688485",{path:"/"})})})(jQuery); | |
/* | |
(function($){ | |
$("a[univ_id=7]").on("click", function(){ | |
$.cookie("gd", parseInt(new Date/1000)); | |
$.cookie("gsu", "12", {path: "/"}); | |
$.cookie("gsuh", "012d30347a0b1899d07967b2c9688485", {path: "/"}); | |
}); | |
})(jQuery); |