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
| /* | |
| I was looking to try a non-kindle e-reader, but my library kept weighing me down. While I had calibre and the de-drm plugin, I found the downloaded books on my kindle were in kfx format and weren't playing well with calibre, even with the kfx input plugin. | |
| Further, I found downloading books directly from web (Amazon > content library) did give me an azw3 file, which works well with de-drm. | |
| To automate part of the process, I wrote a short js script. It doesn't walk through all the pages in content library, but it does download all the books currently visible on the list. Amazon lets us view 25 books per page, so I just had to switch pages, run script, repeat. | |
| The meat of this script is constructing the url used to start a download. Device type, serial number, customer id etc. will be different for everyone, so it's best to download one book manually and check the network inspector for the request details. Apart from the book's `key`, all other details remain same for all the books (at least they did for me |
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
| version: '3.8' | |
| services: | |
| grafana: | |
| image: grafana/grafana:8.4.5-ubuntu | |
| environment: | |
| - GF_DEFAULT_INSTANCE_NAME=grafana.hilandchris.com | |
| - GF_SECURITY_ADMIN_USER=admin | |
| - GF_SECURITY_ADMIN_PASSWORD=admin | |
| - GF_DATABASE_URL=mysql://grafana:grafana@mysql:3306/grafana | |
| ports: |
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
| 0 info it worked if it ends with ok | |
| 1 verbose cli [ '/Users/cjone0102/.asdf/installs/nodejs/10.16.0/bin/node', | |
| 1 verbose cli '/Users/cjone0102/.asdf/installs/nodejs/10.16.0/.npm/bin/npm', | |
| 1 verbose cli 'install', | |
| 1 verbose cli 'grpc' ] | |
| 2 info using [email protected] | |
| 3 info using [email protected] | |
| 4 verbose npm-session 08432355887bac0b | |
| 5 silly install loadCurrentTree | |
| 6 silly install readLocalPackageData |
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
| <!DOCTYPE html> | |
| <!-- | |
| This page shows an animation of colored disks moving around | |
| in a canvas, bouncing off the edges. The program uses WebGL. | |
| All of the points are drawn as single primitive of type POINTS. | |
| The color is an attribute in the vertex shader, allowing | |
| each point to be a different primitive. The user can decide | |
| whether to have randomly colored points or to make all the | |
| points red. The point size is a uniform variable, so all |
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 com.jogamp.opengl.GL2; | |
| import com.jogamp.opengl.glu.GLU; | |
| import java.awt.Component; | |
| import java.awt.event.MouseEvent; | |
| import java.awt.event.MouseListener; | |
| import java.awt.event.MouseMotionListener; | |
| /** | |
| * A Camera object encapsulates the information needed to define a |
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
| #![feature(type_ascription)] | |
| #[no_mangle] | |
| pub extern fn fib(n: i32) -> f64 { | |
| let inverse_five_sqrt:f64 = 1.0/(5.0:f64).sqrt(); | |
| let first_term = (1.0+(5.0:f64).sqrt()) / 2.0; | |
| let second_term = (1.0-(5.0:f64).sqrt()) / 2.0; | |
| (inverse_five_sqrt * first_term.powi(n) - inverse_five_sqrt * second_term.powi(n)).round() | |
| } |
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
| require 'benchmark' | |
| array = [1, 2, 3] | |
| iterations = 1_000_000 | |
| def method_one(array) | |
| hash = {} | |
| array.each do |integer| | |
| hash[integer] = integer ** 2 | |
| end | |
| hash |
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
| def delete(list, element) | |
| if element.prev != nil then | |
| element.prev.next = element.next | |
| else | |
| list.head = x.next | |
| end | |
| if element.next != nil then | |
| element.next.prev = element.prev | |
| 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
| def fib_i(n) | |
| i=0 | |
| two_back = 0 | |
| one_back = 1 | |
| while i<n do | |
| i+=1 | |
| current_answer = one_back + two_back | |
| two_back = one_back | |
| one_back = current_answer | |
| 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
| { | |
| init: function(elevators, floors) { | |
| _.each(floors, function(floor) { | |
| floor.on("up_button_pressed down_button_pressed", function() { | |
| var elevator = elevators[Math.floor(Math.random() + elevators.length) % elevators.length]; | |
| if(elevators.some(function(elevator){ elevator.isDestination(floor.floorNum()) })){ | |
| return; | |
| elevator.goToFloor(floor.floorNum()); | |
| }); | |
| }); |
NewerOlder