Skip to content

Instantly share code, notes, and snippets.

View actuosus's full-sized avatar

Arthur Chafonov actuosus

View GitHub Profile
@actuosus
actuosus / @react-native-firebase+messaging+6.4.0.patch
Created April 23, 2020 20:00
React Native Firebase Messaging Patch to use with patch-package when `mutable-content` is number or string
diff --git a/node_modules/@react-native-firebase/messaging/ios/RNFBMessaging/RNFBMessagingSerializer.m b/node_modules/@react-native-firebase/messaging/ios/RNFBMessaging/RNFBMessagingSerializer.m
index 18d69d9..8685051 100644
--- a/node_modules/@react-native-firebase/messaging/ios/RNFBMessaging/RNFBMessagingSerializer.m
+++ b/node_modules/@react-native-firebase/messaging/ios/RNFBMessaging/RNFBMessagingSerializer.m
@@ -113,7 +113,7 @@ + (NSDictionary *)remoteMessageUserInfoToDict:(NSDictionary *)userInfo {
}
// message.mutableContent
- if (apsDict[@"mutable-content"] != nil && [apsDict[@"mutable-content"] isEqualToString:@"1"]) {
+ if (apsDict[@"mutable-content"] != nil && [apsDict[@"mutable-content"] intValue] == 1) {
@actuosus
actuosus / react-native-image-crop-picker+0.28.0.patch
Created April 13, 2020 13:53
Patch file to compile react-native-image-crop-picker with Xcode 10
diff --git a/node_modules/react-native-image-crop-picker/ios/QBImagePicker/QBImagePicker/QBAssetsViewController.m b/node_modules/react-native-image-crop-picker/ios/QBImagePicker/QBImagePicker/QBAssetsViewController.m
index 0a9fddb..865854b 100644
--- a/node_modules/react-native-image-crop-picker/ios/QBImagePicker/QBImagePicker/QBAssetsViewController.m
+++ b/node_modules/react-native-image-crop-picker/ios/QBImagePicker/QBImagePicker/QBAssetsViewController.m
@@ -194,9 +194,11 @@ - (void)setUpToolbarItems
// Info label
UIColor *labelColor = [UIColor blackColor];
+ #ifdef __IPHONE_13_0
if (@available(iOS 13.0, *)) {
@actuosus
actuosus / md5.sh
Created April 25, 2017 13:56
Detect macOS and fallback md5sum
# Detect OS
OS="`uname`"
case $OS in
'Linux')
OS='Linux'
alias ls='ls --color=auto'
;;
'FreeBSD')
OS='FreeBSD'
alias ls='ls -G'
@actuosus
actuosus / Appfile
Created February 19, 2016 01:10
otto compile crash
application {
name = "csport"
type = "custom"
dependency { source = "github.com/hashicorp/otto/examples/mysql" }
dependency { source = "github.com/hashicorp/otto/examples/redis" }
}
project {
name = "csport"
infrastructure = "vp"
@actuosus
actuosus / Appfile
Last active February 19, 2016 00:59
otto dev destroy crash
application {
name = "csport"
type = "docker-external"
dependency { source = "github.com/hashicorp/otto/examples/mysql" }
dependency { source = "github.com/hashicorp/otto/examples/redis" }
}
project {
name = "csport"
infrastructure = "test"
Index: public/js/views/search_input.js
===================================================================
--- public/js/views/search_input.js (revision )
+++ public/lib/js/views/search_input.js (revision )
@@ -101,7 +101,7 @@
// `facetMatches` callback to skip any further ordering done client-side.
autocompleteValues : function(req, resp) {
var searchTerm = req.term;
- var lastWord = searchTerm.match(/\w+\*?$/); // Autocomplete only last word.
+ var lastWord = searchTerm.match(/[a-zA-Zа-яА-ЯёЁ]+\*?$/); // Autocomplete only last word.
Index: public/js/views/search_facet.js
===================================================================
--- public/js/views/search_facet.js (revision )
+++ public/lib/js/views/search_facet.js (revision )
@@ -167,7 +167,7 @@
resp(matches);
} else {
var re = VS.utils.inflector.escapeRegExp(searchTerm || '');
- var matcher = new RegExp('\\b' + re, 'i');
+ var matcher = new RegExp('[^a-zA-Zа-яА-ЯёЁ]' + re, 'i');
@actuosus
actuosus / scroll_bug_test.html
Created April 14, 2015 17:13
Chrome scroll bug
<style>
.fixed {
position: fixed;
min-width: 600px;
top: 20px;
bottom: 20px;
right: 20px;
overflow-y: auto;
border: 1px solid gray;
padding: 20px;
@actuosus
actuosus / nginx.conf
Created January 24, 2014 14:51
nginx request slowdown.
http {
# ...
server {
listen 8081;
server_name localhost;
location / {
proxy_pass http://localhost:8000/;
proxy_buffering on;
@actuosus
actuosus / Scuba Diving.xml
Created October 24, 2012 08:04
Scuba Diving JOSM Tagging Preset
<annotations
xmlns="http://josm.openstreetmap.de/tagging-preset-1.0"
author="Role74, Tric, actuosus"
version="0.11"
shortdescription="Tauchplatz properties"
description="dive sites"
de.shortdescription="Eigenschaften Tauchplatz"
de.description="Eigenschafen Tauchplätze"
ru.shortdescription="Свойства мест погружения"
ru.description="Места погружений"