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 / install.sh
Last active May 24, 2018 18:36
Mac Dev Setup
# `brew cask`
### general
google-chrome
firefox
transmission
spotify
vlc
dropbox
@birkir
birkir / webpack-3.8.1
Created April 10, 2018 03:09
create-react-app version difference
Hash: 2cd658402a991928a388
Version: webpack 3.8.1
Time: 686ms
Asset Size Chunks Chunk Names
ee53185497446fd9a1e1.hot-update.json 44 bytes [emitted]
static/media/logo.5d5d9eef.svg 2.67 kB
static/js/bundle.js 1.48 MB 0 [emitted] [big] main
0.1fee3bef13b0061408c8.hot-update.js 5.15 kB 0 [emitted] main
1fee3bef13b0061408c8.hot-update.json 43 bytes [emitted]
static/js/bundle.js.map 1.68 MB 0 [emitted] main
---
format_version: '4'
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
project_type: fastlane
app:
envs:
- FASTLANE_XCODE_LIST_TIMEOUT: '120'
- opts:
is_expand: false
FASTLANE_WORK_DIR: android
diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
index 332129b..5bdbb9d 100644
--- a/android/app/src/main/AndroidManifest.xml
+++ b/android/app/src/main/AndroidManifest.xml
@@ -20,7 +20,13 @@
android:name=".MainActivity"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
- android:windowSoftInputMode="adjustResize">
+ android:windowSoftInputMode="adjustResize"
@birkir
birkir / mario.react.jsx
Last active March 9, 2018 06:10
Super Mario world in declarative react components
const World1_1 = (
<World name="1-1">
<Bush x={14} y={1} width={4} />
<Question x={24} y={4} coin />
<Bricks x={27} y={4} width={5} height={1}>
<Question x={28} y={4} special />
<Question x={28} y={4} coin />
</Bricks>
<Question x={24} y={4} coin />
<Bush x={30} y={1} width={2} />
@birkir
birkir / create-react-app.patch
Last active March 6, 2018 22:54
Server side rendering create-react-app
From d5dd3de72a08bc671e33c484f9c1854dc817e20a Mon Sep 17 00:00:00 2001
From: Birkir Gudjonsson <birkir.gudjonsson@gmail.com>
Date: Tue, 6 Mar 2018 17:39:46 -0500
Subject: [PATCH 1/1] Server-side rendering create-react-app
---
package.json | 11 +++
patches/react-dev-utils+6.0.0-next.47d2d941.patch | 14 ++++
patches/react-scripts+2.0.0-next.47d2d941.patch | 24 +++++++
server/app.js | 42 +++++++++++
@birkir
birkir / changes.diff
Last active February 8, 2018 18:40
Changes made to react-three-renderer-fiber to just get it working in react-native
diff --git a/src/bridge/React3.tsx b/src/bridge/React3.tsx
index 00d63f5..05b1ac5 100644
--- a/src/bridge/React3.tsx
+++ b/src/bridge/React3.tsx
@@ -1,8 +1,8 @@
import * as React from "react";
import {PureComponent} from "react";
-
import * as ReactDOM from "react-dom";
import ReactThreeRenderer from "../core/renderer/reactThreeRenderer";
app:processDebugManifest UP-TO-DATE
:app:processDebugResources
:app:generateDebugSources
:app:incrementalDebugJavaCompilationSafeguard UP-TO-DATE
:app:compileDebugJavaWithJavac
:app:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
/Users/***/Projects/***/android/app/src/main/java/com/***/MainApplication.java:25: error: cannot find symbol
public class MainApplication extends NavigationApplication implements ReactInstanceHolder {
^
symbol: class ReactInstanceHolder
@birkir
birkir / index.js
Created November 16, 2017 18:49
requirebin sketch
const css2rn = require('css-to-react-native');
const input = document.getElementById('code');
const result = document.getElementById('result');
const strrf = str => str.trim().replace(/^"/, "'").replace(/",?$/, "'");
const btn = document.querySelector('#go');
btn.addEventListener('click', () => {
const rules = input.value.replace(/\/\*(.|\n)*?\*\//, '').split(';').map(item => item.split(':').map(x => String(x).trim())).filter(x => x && x[0] !== '');
const output = JSON.stringify(css2rn.default(rules), null, 2);
const ok = output.replace(/ \"(.*)\":(.*)\n/g, (n, a, b) => { return ` ${a}: ${strrf(b)},\n`; }).replace(/,,/g, ',');
@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;
}