Skip to content

Instantly share code, notes, and snippets.

View ppeszko's full-sized avatar

Patryk Peszko ppeszko

View GitHub Profile
const fs = require("fs");
const bundle = fs.readFileSync("path-to-webpack-bundle.html", "utf8");
const escaped = JSON.stringify(bundle);
const js = `export default ${escaped}`;
fs.writeFileSync("javascript-output-file.ts", js);
@ppeszko
ppeszko / ios-bitrise.yml
Created October 5, 2020 11:45 — forked from PillowUnicorn/ios-bitrise.yml
Pillow's iOS bitrise.yml
---
format_version: 1.1.0
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
app:
envs:
- BITRISE_PROJECT_PATH: ios/pro_mobile.xcodeproj
opts:
is_expand: false
- BITRISE_SCHEME: pro_mobile
opts:
@ppeszko
ppeszko / android_bitrise.yml
Created October 5, 2020 11:45 — forked from PillowUnicorn/android_bitrise.yml
Pillow's Android bitrise.yml
---
format_version: 1.1.0
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
trigger_map:
- push_branch: qa
workflow: qa
workflows:
_init_install:
steps:
- activate-ssh-key:
@ppeszko
ppeszko / example.com.conf
Created December 15, 2019 17:13 — forked from audiodude/example.com.conf
nginx configuration for Mastodon
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 80;
listen [::]:80;
server_name example.com;
return 301 https://$host$request_uri;
### Keybase proof
I hereby claim:
* I am ppeszko on github.
* I am patryk_peszko (https://keybase.io/patryk_peszko) on keybase.
* I have a public key ASB-ehWyN_bqnAs1n0ld5q-ZndWJo5_zq3lFl5O5GSbBOQo
To claim this, I am signing this object:
@ppeszko
ppeszko / Localisation.swift
Created November 4, 2016 08:13
Language switching without phone restart
let resourceName: String
switch userLanguage {
case .German:
resourceName = "Base"
case .French:
resourceName = "fr"
case .Unknown:
resourceName = nameFromPhoneDefaults()
}
// In the past I was calling it Notification but iOS10
// NSNotification was renamed to Notification, so ¯\_(ツ)_/¯
protocol Notifiable: RawRepresentable {
func post(userInfo aUserInfo: [NSObject : AnyObject]?, object anObject: AnyObject?)
func observe(observer: AnyObject, selector aSelector: Selector, object anObject: AnyObject?)
func name() -> String
func notificationCenter() -> NSNotificationCenter
// It's just an example for notifications. The rest can be safely ignored :)
class HappyPaymentViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
PaymentNotifications.accepted.observe(self,
selector: #selector(HappyPaymentViewController.paymentNotificationReceived(_:)))
PaymentNotifications.rejected.observe(self,
selector: #selector(HappyPaymentViewController.paymentNotificationReceived(_:)))
import UIKit
struct Payment { }
enum PaymentResponse {
case Accepted(Payment)
case Rejected(Payment)
}
// It's just an example for notifications. The rest can be safely ignored :)
<br /><br />
# React Native: Animated
ReactEurope 2015, Paris - Spencer Ahrens - Facebook
<br /><br />
## Fluid Interactions
- People expect smooth, delightful experiences