Skip to content

Instantly share code, notes, and snippets.

View birkir's full-sized avatar
👋
Howdy

Birkir Gudjonsson birkir

👋
Howdy
View GitHub Profile
@birkir
birkir / RCCViewController.m
Created August 17, 2017 18:09
Background color overlay for navbar blur
// Line 477
if (![viewController.navigationController.navigationBar viewWithTag:BLUR_NAVBAR_TAG]) {
UIBlurEffectStyle *blurStyle = UIBlurEffectStyleLight;
NSString *navBarBlurStyle = self.navigatorStyle[@"navBarBlurStyle"];
if (navBarBlurStyle) {
if ([navBarBlurStyle isEqualToString:@"extralight"]) {
blurStyle = UIBlurEffectStyleExtraLight;
}
@birkir
birkir / shared-element-transition.js
Last active October 31, 2018 21:13
SharedElementTransition for ios using react-native-navigation by wix
import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { Dimensions, Animated, View, Text, findNodeHandle } from 'react-native';
import { Navigation } from 'react-native-navigation';
import Modal from './Modal';
const RCTUIManager = require('NativeModules').UIManager;
const data = {
translateX: new Animated.Value(0),
translateY: new Animated.Value(0),
@birkir
birkir / sharedElementTransition.js
Created August 9, 2017 16:28
Pseudo Shared Element Transition with react-native-navigation
// 1. Measure source component in window.
// 2. Show modal with cloned source component.
// 3. Hide source component.
// 4. Start transition of cloned component to destination component position.
// 5. Push destination screen.
// 6. Finish transition.
// 7. Show destination component.
// 8. Fade cloned component out.
// 9. Dismiss modal.
@birkir
birkir / adcWS.py
Created July 28, 2017 02:36
ADC WebSocket
import RPi.GPIO as GPIO
from SimpleWebSocketServer import SimpleWebSocketServer, WebSocket
GPIO.setmode(GPIO.BCM)
clients = []
class ADCDump(WebSocket):
def sendADC(pin, clock, mosi, miso, cs):
@birkir
birkir / webview-onscroll.patch
Created July 26, 2017 16:06
react native WebView onScroll patch
From 12d5a33175038d872d9d6ca8acb00e57f99202c7 Mon Sep 17 00:00:00 2001
From: Birkir Gudjonsson <birkir.gudjonsson@gmail.com>
Date: Wed, 26 Jul 2017 11:53:42 -0400
Subject: [PATCH] Added onScroll
---
Libraries/Components/WebView/WebView.ios.js | 11 +++++++++++
React/Views/RCTWebView.m | 29 +++++++++++++++++++++++++++++
React/Views/RCTWebViewManager.m | 1 +
3 files changed, 41 insertions(+)
const data = `
14:06:44 63°26'20.53" 18°46'24.30"
14:06:45 63°26'20.37" 18°46'25.95"
14:06:46 63°26'20.21" 18°46'27.56"
14:06:47 63°26'20.05" 18°46'29.10"
14:06:48 63°26'19.92" 18°46'30.53"
14:06:49 63°26'19.76" 18°46'31.86"
14:06:50 63°26'19.62" 18°46'33.17"`
.trim().split`\n`;
POST http://10.10.10.229:1400/MediaRenderer/AVTransport/Control
Content-type: 'text/xml; charset=utf8'
SOAPAction: "urn:schemas-upnp-org:service:AVTransport:1#AddURIToQueue"
body:
<?xml version="1.0" encoding="utf-8" ?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<u:AddURIToQueue xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
<InstanceID>0</InstanceID>
@birkir
birkir / gcp-guide.md
Created February 23, 2017 18:28
Google Cloud Platform deployment guide

Deploying to google app engine is not so difficult task.

  1. Add a new file app.yaml to the project root.
runtime: nodejs
env: flex
  1. Make sure to create a google app engine in a region that supports flexible environment.
@birkir
birkir / name-me.js
Last active February 22, 2017 17:11
Name my function
export default function nameMyFunction(img) {
let hz = '';
let vt = '';
let b = 0;
const s = 3;
const canvas = document.createElement('canvas');
canvas.width = img.width;
canvas.height = img.height;
@birkir
birkir / gps-plugin.js
Last active February 11, 2020 21:57
GPS Plugin for BMW ibus interface
/**
* This plugin will emit events with GPS coordinates
*
* const gps = new GPSPlugin();
* gps.on('gps', ({ lat, lng, alt }) => console.log(lat, lng, alt));
* MINI.addPlugin(gps);
*/
class GPSPlugin {
/**