Skip to content

Instantly share code, notes, and snippets.

View Rayer's full-sized avatar

Rayer Rayer

View GitHub Profile
@Rayer
Rayer / PDocProcessor.go
Created May 27, 2020 15:59
GO Routine loop
func ParseRangeDocumentAsync(board string, start int, end int) (ret []*PDocRaw) {
parseChannel := make(chan *PDocRaw, 2)
var count int
docUrlList := make([]string, 0)
_ = IterateDocuments(board, start, end, func(docUrl string) {
docUrlList = append(docUrlList, docUrl)
})
for _, docUrl := range docUrlList {
Report generated at : 2019-08-28 12:53:18
User have used 10 and more IPs :
MK250 (11) : 101.137.132.164 101.136.189.172 101.136.32.174 175.180.69.186 101.136.166.203 101.137.233.208 101.137.212.236 101.136.215.250 101.137.75.34 101.136.236.60 101.137.221.64
dreamer15 (14) : 101.14.172.171 101.10.52.172 49.217.176.228 101.11.44.245 49.216.3.1 49.216.19.7 49.218.108.9 49.216.239.42 175.96.116.50 115.82.116.101 101.8.141.102 49.218.53.110 115.82.77.113 180.204.53.114
frtwwilo (11) : 101.15.236.137 115.82.180.147 180.204.236.158 101.10.108.175 101.13.172.27 49.216.13.35 101.15.236.39 101.9.245.62 180.204.76.71 101.15.141.83 49.217.204.83
h22212247888 (11) : 49.216.4.135 115.82.145.166 101.12.0.195 49.219.160.237 1.200.222.6 117.19.130.31 101.10.37.46 180.217.83.56 101.12.45.72 101.12.24.87 101.12.47.117
loveHyeri (20) : 223.137.42.143 223.137.42.158 114.136.125.165 111.71.120.187 111.71.121.194 111.71.118.195 223.137.44.217 42.73.252.223 114.136.247.224 114.136.237.225 223.137.181.249 223.140.228.249 223.140
@Rayer
Rayer / report.txt
Created August 23, 2019 08:49
Analyze report for recent 2000 posts in HatePolitics
This file has been truncated, but you can view the full file.
User with 5 and more IPs :
Andrew90 : 101.137.59.163 1.173.217.186 111.254.53.87 101.137.209.96 36.238.61.114
Bartholemew : 114.136.24.161 223.136.166.241 223.137.175.246 223.136.220.20 223.137.40.70 223.136.180.95
CenaWang : 223.140.210.130 223.140.15.131 180.217.134.135 180.217.98.168 223.140.103.175 111.71.13.201 223.137.109.224 39.8.229.46 223.137.99.92 223.137.102.114 1.200.203.126
Cosmoswalker : 111.254.65.143 42.77.222.147 223.139.22.11 42.77.250.68 114.40.46.95 223.139.192.117
Crazyfire : 118.167.132.151 1.167.52.155 39.9.1.164 1.167.52.186 1.163.28.200 1.167.53.202 39.10.103.231 36.227.124.232 118.167.143.232 1.167.52.252 27.242.100.254 118.167.135.32 118.167.136.38 39.9.194.63 39.12.133.68
DavidFoster : 61.223.21.129 125.230.105.176 42.76.213.207 122.118.44.239 223.138.161.2 61.223.22.22 118.170.151.26 36.234.113.61 61.224.181.77 111.83.185.89
Dazzium : 61.227.85.137 1.174.32.178 42.75.12.238 42.74.208.36 1.174.42.118 223.139.117.118 1.174.39.119
DrOGC : 111.71.67.145 36.229.142.160 114.136.
@Rayer
Rayer / report.txt
Created August 23, 2019 08:23
Analyze report for latest 2000 PTT gossiping posts
User with 5 and more IPs :
ABA0525 : 111.254.22.174 118.171.20.213 42.74.172.222 42.77.20.227 223.139.149.17
Cersei : 39.9.222.2 110.26.222.2 39.10.158.3 39.12.158.10 27.242.94.15 27.246.30.20 39.10.158.23 27.242.94.39 39.8.158.39 39.10.158.41 27.246.94.42 27.242.222.43 39.8.94.50 39.10.30.52 39.10.158.53 39.12.158.54 27.247.30.71 27.242.158.85 27.242.30.89 27.52.94.97 27.52.94.103 27.52.94.106 39.9.30.108
Corbenikc : 27.52.94.128 114.34.140.149 39.10.30.2 27.246.94.3 27.246.222.17 110.26.222.20 39.12.158.21 39.9.158.23 27.52.94.24 39.8.158.26 39.10.158.28 39.12.30.35 39.10.94.36 39.10.30.37 110.28.30.42 27.246.158.43 39.12.222.52 27.246.222.54 39.9.94.59 27.242.94.65 27.242.94.67 39.12.158.69 27.242.94.71 27.246.94.93 27.246.158.100 39.9.94.104 39.8.94.111 49.216.9.124
Freeven : 180.217.146.247 180.217.135.248 180.217.143.76 110.50.142.88 180.217.166.104
Jason0813 : 110.26.190.132 27.52.190.189 36.231.137.213 114.34.179.237 39.8.126.46
Kikoro : 49.216.43.141 101.15.227.217 101.8.196.12 175.97.17.75 101
NSArray* searchImageSuffix = @[@".jpg", @".jpeg", @".gif", @".tiff", @".png"];
if ([shortURL hasPrefix: @"sm"] && [shortURL length] <= 10 && isAllDigit([shortURL substringFromIndex: 2])) {
addShortenedURLMenuItem([@"NicoNico/" stringByAppendingString: shortURL],
[@"http://www.nicovideo.jp/watch/" stringByAppendingString: shortURL]);
} else if ([shortURL hasPrefix: @"id="] && [shortURL length] <= 12 && isAllDigit([shortURL substringFromIndex: 3])) {
addShortenedURLMenuItem([@"pixiv_illust/" stringByAppendingString: shortURL],
[@"http://www.pixiv.net/member_illust.php?mode=medium&illust_" stringByAppendingString: shortURL]);
} else if ([shortURL hasPrefix: @"mid="] && [shortURL length] <= 12 && isAllDigit([shortURL substringFromIndex: 4])) {
addShortenedURLMenuItem([@"pixiv_member/" stringByAppendingString: [shortURL substringFromIndex: 4]],
@Rayer
Rayer / ifWithBlock
Last active March 11, 2019 14:34
Using block in if statements
if (^(NSArray* searchImageSuffix) {
for(NSString* suffix in searchImageSuffix) {
if([shortURL hasSuffix:suffix])
return TRUE;
}
return FALSE;
}(searchImageSuffix))
{
addShortenedURLMenuItem(@"Image search by GOOGLE", [@"https://www.google.com/searchbyimage?&image_url=" stringByAppendingString: shortURL]);
}
#include <iostream>
using namespace std;
int main(int argc, char *argv[]) {
int *i = 0;
i += 10;
cout << i << endl;
cout << *i << endl;
}
@Rayer
Rayer / ObjectUtils.java
Created February 13, 2015 07:40
New or initialize a object with a parent class instance
public class ObjectUtils {
public static <T> T initByParent(T target, Object parent) throws IllegalAccessException {
Class<?> parentClass = target.getClass().getSuperclass();
if(parent.getClass() != parentClass) {
throw new IllegalArgumentException("Invalid parent!");
}
Field[] fields = parentClass.getDeclaredFields();
import java.util.Random;
class Untitled {
public static void main(String[] args) {
Random random = new Random();
for(int i = 0; i < 100; ++i) {
if(random.nextInt() % 4 == 0)
System.out.print("O");
else
#include <iostream>
#include <string>
#include <typeinfo>
using namespace std;
class foo {
std::string name;
public: