Skip to content

Instantly share code, notes, and snippets.

@frosas
frosas / revolut-terms-diff.patch
Last active Apr 18, 2020
Revolut Terms and Conditions 2019-09-06 vs 2020-04-18 diff
View revolut-terms-diff.patch
2a3,5
>
> Download as a PDFhere
>
53c56
< You can check all payments into and out of your account through the Revolut app. We will not make any changes to your account information and it will be available to you through the Revolut app for six years after you close your account. If you need to keep a copy of the information after then, you will need to download it. You can download information from the app at any time.
---
> You can check all payments into and out of your account through the Revolut app. We will not make any changes to your account information. It will be available to you through the Revolut app while you are a customer. It will also remain available through the Revolut app for six years after you close your account. If you need to keep a copy of the information after then, or if you need to keep a copy of it outside of the app, you will need to download it. You can download this information from the app at any time.
131c134
< Email us on feedback@revolut.com or formalcomplaints@revolut.co
@frosas
frosas / index.js
Created Apr 15, 2019
setupGlobalDom()
View index.js
const setupGlobalDom = () => {
const originalDocument = global.document;
const originalWindow = global.window;
global.document = jsdom('');
global.window = global.document.defaultView;
return () => {
global.document = originalDocument;
global.window = originalWindow;
}
}
@frosas
frosas / README.md
Last active Nov 4, 2017
Hacker News Comments Filter
View README.md

Usage

Copy/paste index.js into your browser console. Then,

// Non-Angular Javascript contract positions in London or remote
hn.filter(
  hn.or(/(javascript|typescript)/i, /ES\d/, 'JS'),
  hn.not(/angular/i),
  /contract/i,
@frosas
frosas / README.md
Last active Oct 25, 2017
Profiling a Node process using flame graphs
View README.md

Profiling a Node process using flame graphs

(assuming an Ubuntu machine)

Setup

  • Install perf: sudo apt-get install linux-tools-generic
  • Run perf and install any other listed missing package: (e.g.) sudo apt-get install linux-tools-4.4.0-1022-aws linux-cloud-tools-4.4.0-1022-aws
  • Enable symbols mapping when running the Node process: node --perf-basic-prof ...
@frosas
frosas / index.js
Last active Aug 9, 2017
HN Most Replied Comments
View index.js
// Shows only the most replied comments in https://news.ycombinator.com post and
// comment pages.
(() => {
const INDENT_WIDTH = 12; // TODO Detect it automatically?
class CommentTreeNode {
constructor(attrs) {
this.children = [];
@frosas
frosas / index.md
Created Jan 7, 2014
Use static node/npm if system one is not new enough (WIP)
View index.md
# Make sure we have an up to date node/npm
NODE_VERSION="v0.10.22"
if [[ $(echo -e "$NODE_VERSION\n$(node -v)" | sort -n | tail -n1) == $NODE_VERSION ]]; then
    NODE_DIR=node-$NODE_VERSION-linux-x86
    wget -q http://nodejs.org/dist/$NODE_VERSION/$NODE_DIR.tar.gz -O - | tar xzf -
    export PATH=$(cd ./$NODE_DIR/bin && pwd):$PATH
fi
View PerProcessConnectionFactory.php
<?php
namespace Acme\Bundle;
use Doctrine\Bundle\DoctrineBundle\ConnectionFactory;
use Doctrine\Common\EventManager;
use Doctrine\DBAL\Configuration;
class PerProcessConnectionFactory extends ConnectionFactory
{
View main.user.js
// ==UserScript==
// @name Toggl Icon
// @namespace http://gist.github.com/4026211
// @version 0.2.3
// @description Shows whether tracking is running in the page icon
// @match https://www.toggl.com/track
// @copyright 2012, Francesc Rosàs
// ==/UserScript==
var onElementAttributesChange = function(element, callback) {
@frosas
frosas / 1 - README.md
Created Oct 18, 2012
Toggl Icon & Shortcuts
View 1 - README.md
View 0 index.md

This is a title

Blah blah blah

<?php
echo "I'm PHP code";
You can’t perform that action at this time.