Skip to content

Instantly share code, notes, and snippets.

@lnicola
lnicola / hb_all_books_dl.js
Created December 1, 2017 18:25 — forked from barrywoolgar/hb_all_books_dl.js
Humble bundle book bundles - download all books at once
/*
After purchasing a humble book bundle, go to your download page for that bundle.
Open a console window for the page and paste in the below javascript.
This will download all the books in all the formats available.
*/
var s = "";
$('.js-start-download a').each(function() {
s += $(this).attr("href") + "\n";
});
console.log(s);
use std::cmp::Ordering;
use std::collections::BinaryHeap;
struct Node {
weight: i32,
item: Item,
}
impl Ord for Node {
fn cmp(&self, other: &Self) -> Ordering {
#include <cstdio>
#include <cstdlib>
#include <sys/acl.h>
#include <sys/types.h>
#include <acl/libacl.h>
#include <errno.h>
#include <string.h>
#include <pwd.h>
#include <grp.h>
#include <array>
#include <condition_variable>
#include <cstdio>
#include <mutex>
#include <iostream>
#include <string>
#include <vector>
#include <thread>
#include <errno.h>
(* Content-type: application/vnd.wolfram.mathematica *)
(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)
(* CreatedBy='Mathematica 10.0' *)
(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
(defun rw1 (in pred)
"Returns a string of consecutive chars for which pred returns true from the in stream."
(declare (optimize (safety 0) (speed 3)))
(let (buf)
(do ((c #1=(peek-char nil in nil #\Nul) #1#))
((or (char= c #\Nul)
(not (funcall pred c))) (coerce (nreverse buf) 'string))
(push (read-char in) buf))))
(defun rw2 (in pred)
#include <chrono>
#include <iostream>
#include <string>
#include <sstream>
using namespace std;
class stopwatch
{
std::chrono::high_resolution_clock::time_point start;
using System.Diagnostics;
using System.IO;
using System.Net.Sockets;
using System.Threading;
namespace RtpTest
{
class Program
{
static void AnnouncementThread()
if \(data\.message === "([^"]+)"\) bot\.sendChat\("([^"]+)"\);
"$1": "$2",
(define-fun palindrome ((n Int)) Bool
(exists ((a Int) (b Int) (c Int))
(and (>= a 1) (<= a 9)
(>= b 0) (<= b 9)
(>= c 0) (<= c 9)
(= n (+ (* 100000 a) (* 10000 b) (* 1000 c) (* 100 c) (* 10 b) a)))))
(define-fun solution ((n Int)) Bool
(exists ((factor1 Int) (factor2 Int))
(and (>= factor1 100) (< factor1 1000)