This file contains hidden or 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
| #include <stdio.h> // printf | |
| #include <unistd.h> // alarm | |
| #include <signal.h> // signal | |
| #include <stdlib.h> // exit | |
| #include <stdbool.h> // true | |
| int64_t how_many; | |
| void handler(int signal) { | |
| if (signal==SIGALRM) { |
This file contains hidden or 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 sys | |
| import random | |
| import signal | |
| def handler(signum, frame): | |
| print(how_many) | |
| sys.exit() | |
| signal.signal(signal.SIGALRM, handler) |
This file contains hidden or 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
| # frozen_string_literal: true | |
| require 'timeout' | |
| how_many = 0 | |
| rand_generator = Random.new | |
| begin | |
| Timeout.timeout(1) do | |
| loop do |
This file contains hidden or 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
| [package] | |
| name = "resolver" | |
| version = "0.1.0" | |
| authors = ["Paulo Henrique Rodrigues Pinheiro <paulohrpinheiro@gmail.com>"] | |
| [dependencies] | |
| libc = "0.2.8" |
This file contains hidden or 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
| #!/usr/bin/env ruby | |
| require 'redcarpet' | |
| require 'rss' | |
| def write_file(filename, content, description, meta) | |
| File.write( | |
| filename, | |
| %(<!--#include virtual="/parts/header_begin.html" -->\n\n) + | |
| "#{meta}\n" + |
This file contains hidden or 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
| #!/usr/bin/env ruby | |
| require 'twitter' | |
| require 'words_counted' | |
| def collect_with_max_id(collection=[], max_id=nil, &block) | |
| response = yield(max_id) | |
| collection += response | |
| response.empty? ? collection.flatten : collect_with_max_id(collection, response.last.id - 1, &block) | |
| end |
This file contains hidden or 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
| //! Crawler — My own crawler in Rust! | |
| extern crate hyper; // biblioteca (crate) não padrão | |
| use std::env; // argumentos env::args | |
| use std::io::{Read, Write}; // para IO de arquivos | |
| use std::fs::File; // para criar arquivos | |
| use std::path::Path; // configurar nome de arquivo | |
| use std::thread; // concorrência | |
This file contains hidden or 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
| //! Crawler — My own crawler in Rust! | |
| extern crate hyper; // biblioteca (crate) não padrão | |
| use std::env; // argumentos env::args | |
| use std::io::{Read, Write}; // para IO de arquivos | |
| use std::fs::File; // para criar arquivos | |
| use std::path::Path; // configurar nome de arquivo | |
| use std::thread; // concorrência | |
This file contains hidden or 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
| DESTDIR=/usr/local | |
| LIBDIR=$(DESTDIR)/lib | |
| INCLUDEDIR=$(DESTDIR)/lib | |
| CFLAGS= | |
| LIBVERSION=0.1 | |
| LIBNAME=libunqlite.so.$(LIBVERSION) | |
| SOLIB=-shared -Wl,--build-id,-soname,$(LIBNAME) -o $(LIBNAME) | |
| $(LIBNAME): unqlite.c |
This file contains hidden or 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
| The MIT License (MIT) | |
| Copyright (c) 2016 Paulo Henrique Rodrigues Pinheiro <paulo@sysincloud.it> | |
| Permission is hereby granted, free of charge, to any person obtaining a copy | |
| of this software and associated documentation files (the "Software"), to deal | |
| in the Software without restriction, including without limitation the rights | |
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| copies of the Software, and to permit persons to whom the Software is | |
| furnished to do so, subject to the following conditions: |