It reads your torrents. Spit out magnet URIs.
$ ./magneto.rb magneto.rb.torrent
Results in:
#!/usr/bin/ruby | |
require 'rubygems' | |
require 'nokogiri' | |
XSL = <<-EOXSL | |
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | |
<xsl:output method="xml" encoding="ISO-8859-1"/> | |
<xsl:param name="indent-increment" select="' '"/> | |
<xsl:template name="newline"> |
It reads your torrents. Spit out magnet URIs.
$ ./magneto.rb magneto.rb.torrent
Results in:
I posted this gist a few years ago as a quick memo for myself. I never expect this little gist to rank up in top 3 search result and getting so many helpful feedbacks. Since it gets viewed quite often, I decided to revise this post so that it may be a little more helpful. Thank you again for the feedback!
require "json"
class MyJSON
#!/usr/bin/env ruby | |
# "trim" is nnow built in, so this is easy | |
require 'vips' | |
im = Vips::Image.new_from_file(ARGV[0]) | |
left, top, width, height = im.find_trim | |
im = im.crop(left, top, width, height) |
columns_that_make_record_distinct = [:some_id, :another_name] | |
duplicate_records = Model.where.not(id: Model.select("MIN(id) as id").group(columns_that_make_record_distinct)) |
#!/bin/bash | |
# Note that there's no libdrm because this lib cause errors | |
sudo apt update -y && sudo apt upgrade -y | |
sudo apt-get -y install \ | |
autoconf \ | |
automake \ | |
build-essential \ |