Skip to content

Instantly share code, notes, and snippets.

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class SayNumbers {
public static void main(String[] args) {
String[] strings = {"000", "100", "001", "011", "111", "321", "1000", "1001", "000000", "000001", "001001", "1000000",
"22329192", "569045", "100000000000000", "12000450345000", "100, 000, 000, 000, 000", "100, 000, 000, 000, 00000"};
for (String s : strings) {
// String[] tokens = splitReverse(s, 3);
@nyannko
nyannko / tcpecho.c
Last active December 16, 2017 18:28
/************
tcp_server.c
************/
#include<stdio.h>
#include<stdlib.h>
#include<sys/types.h>
#include<sys/socket.h>
#include<netinet/in.h>
@nyannko
nyannko / animelist.java
Created May 30, 2017 20:42
Grab top 50 anime in myanimelist
import java.io.IOException;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
public class scraper {
public static void main(String[] args) throws IOException {
Document doc = Jsoup.connect("https://myanimelist.net/topanime.php").get();
for(Element row: doc.select(".ranking-list")) {
String title = row.select(".title").text();
#/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import csv
import os
from os import walk
import re
f =[]
@nyannko
nyannko / redirect.py
Last active March 14, 2017 21:29
use selenium login to foursquare and use their api
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import foursquare
import urllib
from selenium import webdriver
import time
import getpass
client_id = raw_input('Client ID: ')