Skip to content

Instantly share code, notes, and snippets.

@jevakallio
jevakallio / readme.md
Last active April 22, 2024 15:51
`adb pull` from app data directory without root access

TL;DR;

com.package.name is your app identifier, and the file path is relative to the app user's home directory, e.g. '/data/user/0/com.package.name.

adb shell run-as com.package.name cp relative/path/file.ext /sdcard
adb pull /sdcard/file.ext

See long explanation below.

@jevakallio
jevakallio / requirejs-nested-require-calls.js
Last active November 4, 2022 17:54
A sample showcasing some of the things RequireJS can and can not do.
//let's say you have these three AMD modules:
//testmodule1.js
define(function() {
var val = { iAm:'testmodule1.js' };
console.log(val);
return val;
});
//testmodule2.js
@jevakallio
jevakallio / COURSE.md
Last active July 24, 2022 02:37
React Native For Beginners

Introduction

React Native makes it possible to make native iOS and Android mobile apps without needing to know any iOS or Android programming - just JavaScript!

In this course, we'll write a simple mobile app that you can run on your own phone and share with your friends!

Prerequisites

In order to take advantage this course, you should have the following experience.

@jevakallio
jevakallio / readme.md
Last active July 18, 2022 11:02
React SSR, SSG, SPA - History & Colour

SSR History & Colour

  • Three React approaches
    • SPA Single Page Applications
    • SSR Server Side Rendering
    • SSG Static Site Generation

    • SPA - Single Page Applications :: fat client, API
      • Send plain javascript that does on everything on client
      • SEO nightmare
  • Google Crawler is starting to execute JavaScript
@jevakallio
jevakallio / synchronized-scrolling.js
Created December 9, 2016 23:54
React Native: Synchronized ScrollViews
import Exponent from 'exponent';
import React from 'react';
import { range } from 'lodash';
import {
StyleSheet,
Dimensions,
ScrollView,
Animated,
Text,
@jevakallio
jevakallio / TweetPresenter.js
Created April 27, 2017 09:28
Tweet Presenter!
// paste this to chrome console on anybody's twitter page
// and it'll turn into an instant presentation :)
(function TweetPresent() {
const presenter = $(`<div id="tpd" style=" position: fixed; top: 0; left: 0; height: 100vh; width: 100vw; padding: 10vh 10vw; box-sizing: border-box; background-color: white; font-size: 5vw; text-align: center; z-index: 9999; display: flex; align-items: center; justify-content: center;"></div>`);
const tweets = $$(`div.tweet p.js-tweet-text`)
.map(el => el.innerHTML)
.map(t => ({t, s: Math.random()}))
.sort((a, b) => a.s > b.s ? -1 : 1)
.map(c => c.t);
@jevakallio
jevakallio / reactiveconf-slam-poetry.md
Last active July 7, 2021 19:57
#ReactiveConf 2017 Lightning Talk Submission: JavaScript Slam Poetry

TL;DR: If you want to see me perform a spoken word poem about JavaScript in front of 1000 people (and on video), please ⭐ star this gist. If you're on mobile, you'll need to request desktop site.

JavaScript Slam Poetry

Javascript! Slam! Poetry!

@jevakallio
jevakallio / HorizontalPicker.js
Created December 14, 2017 12:06
React Native Horizontal Picker
// @flow
// https://twitter.com/jevakallio/status/941258932529614848
import React, { Component, type Node } from 'react';
import styled from 'styled-components/native';
import Touchable from 'react-native-platform-touchable';
import Carousel from 'react-native-snap-carousel';
// $FlowFixMe
import { LinearGradient } from 'expo';
@jevakallio
jevakallio / List.jsx
Last active April 17, 2019 02:46
Apollo/Fraql fragments. just an example, not syntactically correct
import gql from 'fraql'
import { ListRow } from './ListRow';
// this is the whole list
export const List = ({ users }) => (
<ul>
{users.map(user => <ListRow user={user} />)}
</ul>
)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
<meta name="theme-color" content="#000000" />