react + redux + RR
It uses https://gist.github.com/iNikNik/3c1b870f63dc0de67c38 for stores and actions.
1) create redux
const redux = createRedux(state);
2) get requireAccess func => bindCheckAuth to redux
/* | |
the twitter api is stupid. it is stupid and bad and expensive. hence, this. | |
Literally just paste this in the JS console on the bookmarks tab and the script will automatically scroll to the bottom of your bookmarks and keep a track of them as it goes. | |
When finished, it downloads a JSON file containing the raw text content of every bookmark. | |
for now it stores just the text inside the tweet itself, but if you're reading this why don't you go ahead and try to also store other information (author, tweetLink, pictures, everything). come on. do it. please? | |
*/ |
export function serializeServerDataToJsonString(data: Object): string { | |
const jsonString = JSON.stringify(data); | |
return jsonString | |
.replace(/<\/script/gim, '</_escaped_script') | |
.replace(new RegExp('\u2028', 'g'), '\\u2028') | |
.replace(new RegExp('\u2029', 'g'), '\\u2029') | |
.replace(/\\/g, '\\\\') | |
.replace(/\n/g, '\\n') | |
.replace(/\r/g, '\\r') |
/** | |
* Converts an RGB color value to HSL. Conversion formula | |
* adapted from http://en.wikipedia.org/wiki/HSL_color_space. | |
* Assumes r, g, and b are contained in the set [0, 255] and | |
* returns h, s, and l in the set [0, 1]. | |
* | |
* @param Number r The red color value | |
* @param Number g The green color value | |
* @param Number b The blue color value | |
* @return Array The HSL representation |
react + redux + RR
It uses https://gist.github.com/iNikNik/3c1b870f63dc0de67c38 for stores and actions.
1) create redux
const redux = createRedux(state);
2) get requireAccess func => bindCheckAuth to redux