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
#!/usr/bin/env ruby | |
# | |
# Put this script in your PATH and download from onemanga.com like this: | |
# onemanga_downloader.rb Bleach [chapter number] | |
# | |
# You will find the downloaded chapters under $HOME/Documents/OneManga/Bleach | |
# | |
# If you run this script without arguments, it will check your local manga downloads | |
# and check if there are any new chapters | |
# |
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
Unhandled exception: Cannot allocate new fiber stack: Cannot allocate memory (Errno) | |
GC Warning: Failed to expand heap by 2834432 bytes | |
GC Warning: Failed to expand heap by 790528 bytes | |
GC Warning: Out of Memory! Heap size: 5 MiB. Returning NULL! | |
Invalid memory access (signal 11) at address 0x60018 | |
[0x5614ba5a4176] ??? | |
[0x5614ba5a3e8f] __crystal_sigfault_handler +479 | |
[0x7fd6dde91890] ??? | |
[0x5614ba5931d5] ??? | |
[0x5614ba59259b] ??? |
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
# Generated by iptables-save v1.4.2 on Wed Feb 10 02:27:40 2010 | |
*raw | |
:PREROUTING ACCEPT [50797:74255039] | |
:OUTPUT ACCEPT [25636:1371004] | |
COMMIT | |
# Completed on Wed Feb 10 02:27:40 2010 | |
# Generated by iptables-save v1.4.2 on Wed Feb 10 02:27:40 2010 | |
*nat | |
:PREROUTING ACCEPT [152:51984] | |
:POSTROUTING ACCEPT [41:2614] |
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
#!/usr/bin/env ruby | |
# | |
# Brute-force way to retrieve all Github's repositories at once | |
# Usage: | |
# github_repos.rb clone # will clone all the user's repositories | |
# github_repos.rb clone test # will just clone 6 repositories for testing purposes | |
# github_repos.rb pull # will update all of the user's local repositories | |
# | |
# If you have forked repositories, the original sources will be added | |
# as remotes with the default 'forked_from' name, and a new 'forked_from' |
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
require 'disqus' | |
require 'disqus/api' | |
require 'disqus/author' | |
require 'disqus/forum' | |
require 'disqus/post' | |
require 'disqus/thread' | |
require 'disqus/version' | |
desc "Load Blog comments to Disqus" | |
task :load_disqus => :environment do |
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
I, [2017-10-23T15:09:33.083276 #253] INFO -- : Connected to AMQP broker (prefetch: default) | |
I, [2017-10-23T15:09:42.797137 #253] INFO -- : Received: {"mailer_class":"TokenMailer","method":"activation","args":["fabio.akita@minerx.com.br","42473f74aa56ad1164fbf9389f617b50"],"locale":"en"} | |
F, [2017-10-23T15:09:42.797362 #253] FATAL -- : wrong number of arguments (given 3, expected 0) (ArgumentError) | |
/usr/local/bundle/gems/actionmailer-5.0.6/lib/action_mailer/base.rb:582:in `initialize' | |
/app/app/models/worker/email_notification.rb:12:in `new' | |
/app/app/models/worker/email_notification.rb:12:in `process' | |
/app/lib/daemons/amqp_daemon.rb:61:in `block (2 levels) in <top (required)>' | |
/usr/local/bundle/gems/bunny-1.2.2/lib/bunny/consumer.rb:56:in `call' | |
/usr/local/bundle/gems/bunny-1.2.2/lib/bunny/channel.rb:1672:in `block in handle_frameset' | |
/usr/local/bundle/gems/bunny-1.2.2/lib/bunny/consumer_work_pool.rb:84:in `block (2 levels) in run_loop' |
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
# this was copied from https://carc.in/#/r/fg2 | |
# thanks to @waterlink from this issue thread https://github.com/crystal-lang/crystal/issues/1388 | |
module CrChainableMethods | |
module Pipe | |
macro pipe(ast) | |
{% uast = ast.stringify.gsub(/ >>/, ".pipe").id %} | |
{% pp uast %} | |
{% if uast.stringify != ast.stringify %} | |
pipe {{uast}} |
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
def sum(s : Array(Int32), c : Channel(Int32)) | |
c.send s.reduce(0) { |sum, v| sum + v } | |
end | |
def main | |
s = [7, 2, 8, -9, 4, 0] | |
c = Channel(Int32).new | |
spawn { | |
sum(s[0..((s.size / 2) - 1)], c) | |
} |
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
module Pipe | |
def pipe(initial_state) | |
Pipe::PipeChain.new(initial_state, self) | |
end | |
class PipeChain | |
attr_reader :state, :context | |
def initialize(object, context) | |
@state = object |
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
source 'https://rubygems.org' | |
gem 'faraday' | |
gem 'typhoeus' | |
gem 'oj' | |
gem 'parallel' |