Skip to content

Instantly share code, notes, and snippets.

View lnikkila's full-sized avatar

Leo Nikkilä lnikkila

View GitHub Profile
import React from 'react';
import {AppRegistry, LayoutAnimation, StyleSheet, Text, UIManager, View} from 'react-native';
if (UIManager.setLayoutAnimationEnabledExperimental) {
UIManager.setLayoutAnimationEnabledExperimental(true);
}
class LayoutAnimationTest extends React.Component {
constructor(props) {
super(props);
import React from 'react';
import {AppRegistry, LayoutAnimation, StyleSheet, Text, UIManager, View} from 'react-native';
if (UIManager.setLayoutAnimationEnabledExperimental) {
UIManager.setLayoutAnimationEnabledExperimental(true);
}
class LayoutAnimationTest extends React.Component {
constructor(props) {
super(props);
@lnikkila
lnikkila / pull_files.py
Last active January 19, 2018 14:02
Pull specific app files from an unencrypted iOS backup.
#!/usr/bin/env python3
# Pull specific files from an unencrypted iOS backup.
#
# ## Examples
#
# ./pull_files.py ~/backup ~/all_backup_files.zip
# ./pull_files.py -d '%com.example.app%' ~/backup ~/app_files.zip
import argparse
import pathlib
import sqlite3
@lnikkila
lnikkila / README.md
Last active August 29, 2017 18:19
Twilio signature header for Paw

Twilio signature header for Paw

Set up an HMAC-SHA1 header with the attached script as the input, and your Twilio secret as the key like this:

screen shot 2017-08-29 at 09 16 33

The script will calculate a correct signature for any request you throw at it.

@lnikkila
lnikkila / keybase.md
Created May 14, 2017 20:52
Keybase verification

Keybase proof

I hereby claim:

  • I am lnikkila on github.
  • I am lnikkila (https://keybase.io/lnikkila) on keybase.
  • I have a public key ASACtADePGpdUnqYtThROtj3XggJL2zuYcSWGf-_cFSXGgo

To claim this, I am signing this object:

Bookmarklet

Copy and paste this into a bookmark:

javascript:!function(d){d.head.appendChild(d.createElement("style")).innerText="html,img,video{-webkit-filter:invert(1)hue-rotate(180deg);filter:invert(1)hue-rotate(180deg)}body{background:#000}"}(document);
@lnikkila
lnikkila / gist:e9572f21fd005dd06740
Last active January 16, 2018 01:15
Flashing a custom ROM (CyanogenMod) using OS X on Samsung Galaxy Tab 10.1 (WiFi) a.k.a. GT-P7510 a.k.a. p4wifi.

CyanogenMod was discontinued, but I’ll keep this up since you can probably try to flash something else using this. Also Heimdall is still very useful but not much talked about. You should probably use TWRP Recovery instead of ClockworkMod these days.

First install Heimdall using Homebrew Cask. You can also download the .pkg and install it manually. Heimdall includes a kext, so you need to reboot after installation.

<a id="alert-twitter"
href="https://twitter.com/intent/tweet?text=%40lnikkila+Hey%2C+this+link+is+dead%3A&amp;url=">
Twitter link
</a>
<a id="alert-email"
href="mailto:[email protected]?subject=Found+a+dead+link&amp;body=Hey%2C+this+link+is+dead%3A+">
Email link
</a>
/*
* Calculates the sRGB luma of a colour.
*
* Math nicked from a great Thoughtbot article by Reda Lemeden:
* http://robots.thoughtbot.com/closer-look-color-lightness
*/
@function luma($c) {
$-local-red: red(rgba($c, 1.0));
$-local-green: green(rgba($c, 1.0));