Skip to content

Instantly share code, notes, and snippets.

@edvinasbartkus
edvinasbartkus / netinfo.js
Created August 3, 2020 07:38
Mock __mocks__/@react-native-community/netinfo.js
export default {
getCurrentConnectivity: jest.fn(),
isConnectionMetered: jest.fn(),
addListener: jest.fn(),
removeListeners: jest.fn(),
isConnected: {
fetch: () => {
return Promise.resolve(true)
},
addEventListener: jest.fn(),
@edvinasbartkus
edvinasbartkus / bypass.js
Last active October 15, 2023 13:18
bypass paywall for sites like ft.com. Important: IT WILL REMOVE COOKIES (you will be logged out) AND WILL REMOVE LOCATION/SESSION STORAGE
javascript:localStorage.clear();sessionStorage.clear();(function(){var cookies=document.cookie.split("; ");for(var c=0;c<cookies.length;c+=1){var d=window.location.hostname.split(".");while(d.length>0){var cookieBase=encodeURIComponent(cookies[c].split(";")[0].split("=")[0])+'=; expires=Thu, 01-Jan-1970 00:00:01 GMT; domain='+d.join('.')+' ;path=';var p=location.pathname.split('/');document.cookie=cookieBase+'/';while(p.length>0){document.cookie=cookieBase+p.join('/');p.pop()};d.shift()}}})();window.location="https://facebook.com/l.php?u="+encodeURIComponent(window.location.href)
@edvinasbartkus
edvinasbartkus / android.yml
Created November 20, 2019 14:45
Running Detox tests for Android on Github Actions Workflow
name: Android
on: [push]
jobs:
build:
runs-on: macos-latest
steps:
- name: Checkout
@edvinasbartkus
edvinasbartkus / .github-workflows-main.yml
Created November 16, 2019 10:06
Github Action for React Native Detox
name: Detox
on: [push]
jobs:
build:
runs-on: macOS-latest
timeout-minutes: 15
env:
@edvinasbartkus
edvinasbartkus / keybase.md
Created October 5, 2017 06:56
keybase.md

Keybase proof

I hereby claim:

  • I am edvinasbartkus on github.
  • I am edvinasbartkus (https://keybase.io/edvinasbartkus) on keybase.
  • I have a public key ASA2eUHLszc1zENKm7dIHQFQxfiYNOwTSyfw9RClUyBg7go

To claim this, I am signing this object:

#cloud-config
snappy:
ssh_enabled: True
packages:
- docker
write_files:
- path: /var/lib/apps/docker/1.6.2.003/etc/docker.conf
content: |
DOCKER_OPTIONS='-H unix:///var/run/docker.sock -H tcp://0.0.0.0:2375'
@edvinasbartkus
edvinasbartkus / gist:8ed0e61a7c7980c087f1
Created September 2, 2015 13:40
coreos-cloud-config
#cloud-config
coreos:
etcd:
...
units:
- name: docker-tcp.socket
command: start
enable: true
content: |
@edvinasbartkus
edvinasbartkus / gist:0e99ea8305a20737f562
Last active May 20, 2022 11:08
Ruby puma.gem install on El Capitan / Mac Sierra
gem install puma -- --with-cppflags=-I/usr/local/opt/openssl/include --with-ldflags=-L/usr/local/opt/openssl/lib
new Parse('https://news.ycombinator.com/item?id=7216471', function () {
var comments = [];
when('class', 'comment', function () {
var comment = {};
comments.push(comment);
whenText(function (text) {
if (text != 'reply') {
comment.text = (comment.text || '') + text;
}
@edvinasbartkus
edvinasbartkus / parser.js
Created February 2, 2014 22:37
Node: fast HTML parsing with Stream
var request = require('minreq') || require('request'),
WritableStream = require('htmlparser2').WritableStream;
var count = 0;
var done = function () {
console.log('There are ' + count + ' script tags.');
process.exit(1);
};
var handlers = {