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
/* | |
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); |
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
use std::cmp::Ordering; | |
use std::collections::BinaryHeap; | |
struct Node { | |
weight: i32, | |
item: Item, | |
} | |
impl Ord for Node { | |
fn cmp(&self, other: &Self) -> Ordering { |
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
#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> |
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
#include <array> | |
#include <condition_variable> | |
#include <cstdio> | |
#include <mutex> | |
#include <iostream> | |
#include <string> | |
#include <vector> | |
#include <thread> | |
#include <errno.h> |
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
(* Content-type: application/vnd.wolfram.mathematica *) | |
(*** Wolfram Notebook File ***) | |
(* http://www.wolfram.com/nb *) | |
(* CreatedBy='Mathematica 10.0' *) | |
(*CacheID: 234*) | |
(* Internal cache information: | |
NotebookFileLineBreakTest |
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
(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) |
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
#include <chrono> | |
#include <iostream> | |
#include <string> | |
#include <sstream> | |
using namespace std; | |
class stopwatch | |
{ | |
std::chrono::high_resolution_clock::time_point start; |
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
using System.Diagnostics; | |
using System.IO; | |
using System.Net.Sockets; | |
using System.Threading; | |
namespace RtpTest | |
{ | |
class Program | |
{ | |
static void AnnouncementThread() |
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
if \(data\.message === "([^"]+)"\) bot\.sendChat\("([^"]+)"\); | |
"$1": "$2", |
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
(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) |
NewerOlder