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
// The following data should be run in the console while viewing the page https://read.amazon.com/ | |
// It will export a JSON file called "kindleItems.json" | |
(function () { | |
const saveJSON = function (data, filename) { | |
if (!data) { | |
console.error("save: No data"); | |
return; | |
} |
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
const title = (e) => $('div.a-column:nth-child(2) .a-row:nth-child(1) span', e).text().trim(); | |
const authors = (e) => $('div.a-column:nth-child(2) .a-row:nth-child(2) span', e).text().trim(); | |
const started = (e) => $('div.a-column:nth-child(3) .a-row:nth-child(1) span', e).text().trim(); | |
const data = []; | |
$('#itemsList .item').each((i, e) => data.push({title: title(e), authors: authors(e), started: started(e)})); | |
$('<a></a>') | |
.attr('id','downloadJSON') | |
.attr('href','data:application/json;charset=utf8,' + encodeURIComponent(JSON.stringify(data))) | |
.attr('download','unlimited.json') |
This file has been truncated, but you can view the full file.
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
[ | |
{ | |
"id":"http://eurovoc.europa.eu/2000", | |
"terms":[ | |
{ | |
"lt":"antirasistinis judėjimas" | |
}, | |
{ | |
"pl":"ruch przeciw rasizmowi" | |
}, |
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=function(r,e,n){function t(n,o){function i(r){return t(i.resolve(r))}function f(e){return r[n][1][e]||e}if(!e[n]){if(!r[n]){var c="function"==typeof require&&require;if(!o&&c)return c(n,!0);if(u)return u(n,!0);var l=new Error("Cannot find module '"+n+"'");throw l.code="MODULE_NOT_FOUND",l}i.resolve=f;var a=e[n]=new t.Module;r[n][0].call(a.exports,i,a,a.exports)}return e[n].exports}function o(){this.bundle=t,this.exports={}}var u="function"==typeof require&&require;t.Module=o,t.modules=r,t.cache=e,t.parent=u;for(var i=0;i<n.length;i++)t(n[i]);return t}({15:[function(require,module,exports) { | |
exports.endianness=function(){return"LE"},exports.hostname=function(){return"undefined"!=typeof location?location.hostname:""},exports.loadavg=function(){return[]},exports.uptime=function(){return 0},exports.freemem=function(){return Number.MAX_VALUE},exports.totalmem=function(){return Number.MAX_VALUE},exports.cpus=function(){return[]},exports.type=function(){return"Browser"},exports.release=function(){return"unde |
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
brew update && brew upgrade rbenv ruby-build |
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
function equalArrays(a, b) { | |
if (a.length !== b.length) return false; | |
for(var i = 0; i < a.length; i++) | |
if (a[i] !== b[i]) return false; | |
return true; | |
} |
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
var toUnicode = function(str) { | |
var hex = str.charCodeAt(0).toString(16).split(''); | |
while(hex.length < 4) hex.splice(0, 0, 0); | |
return '\"' + '\\u' + hex.join('') + '\"' ; | |
} | |
console.log(toUnicode("π")); |
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
/* float clearing for IE6 */ | |
.clearfix { | |
height: 1%; | |
overflow: visible; } | |
/* float clearing for IE7 */ | |
.clearfix { | |
min-height: 1%; } | |
/* float clearing for everyone else */ |
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
javascript:(function(){var e=function(c){return String.fromCharCode(c);};var d=[e(0x62),e(0x65),e(0x65),e(0x72),e(0x3f)].join(''); var q=window.document.getElementById("q"); if(confirm(d) && q){q.focus();q.value=d.slice(0,4);};})(); |
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
# via http://ujihisa.blogspot.com/2010/02/redirecting-stdout.html | |
def capture_io | |
require 'stringio' | |
orig_stdout, orig_stderr = $stdout, $stderr | |
captured_stdout, captured_stderr = StringIO.new, StringIO.new | |
$stdout, $stderr = captured_stdout, captured_stderr | |
yield |
NewerOlder