Skip to content

Instantly share code, notes, and snippets.

Avatar
💥
shipit

Ioannis Kokkinidis SudoPlz

💥
shipit
View GitHub Profile
View Error
2017-11-01 23:00:18.938794+0200 AcuityApp[79879:2504854] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFData isEqualToString:]: unrecognized selector sent to instance 0x6040000bc570'
*** First throw call stack:
(
0 CoreFoundation 0x000000010f4f51cb __exceptionPreprocess + 171
1 libobjc.A.dylib 0x000000010df5af41 objc_exception_throw + 48
2 CoreFoundation 0x000000010f575914 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
3 CoreFoundation 0x000000010f478178 ___forwarding___ + 1432
4 CoreFoundation 0x000000010f477b58 _CF_forwarding_prep_0 + 120
5 Valet 0x00000001230ba860 -[VALValet migrateObjectsMatchingQuery:removeOnCompletion:] + 2759
6 SquarePaymentSDK 0x0000000109b2d3b4 -[SQSession initWithKeychain:trustedDeviceDetailsPersister:] + 480
View CrashReporter.js
import { Client, Configuration } from 'bugsnag-react-native';
module.exports = { // cached singleton instance
instance: null,
create(key, store, codeBundleId) {
if (this.instance === null) {
if (key == null) {
@SudoPlz
SudoPlz / file.in
Last active Jun 6, 2017
That js file reads a `file.in` input file that contains prop types declarations and outputs an `file.out` file that will act as our shouldComponentUpdate react method. Run it by typing node shouldComponentUpdateCreator.js on your terminal.
View file.in
screenHasLoaded: React.PropTypes.bool.isRequired,
isPartOfClass: React.PropTypes.bool.isRequired,
appointment: React.PropTypes.instanceOf(Map).isRequired,
// formErrors: React.PropTypes.instanceOf(Map).isRequired,
// timezoneZ: React.PropTypes.string.isRequired,
// isModal: React.PropTypes.bool.isRequired,
isClass: React.PropTypes.bool.isRequired,
classSize: React.PropTypes.number,
h: React.PropTypes.number.isRequired,
@SudoPlz
SudoPlz / updater.js
Created Jun 6, 2017
That js file reads a `file.in` input file that contains prop types declarations and outputs an `file.out` file that will act as our shouldComponentUpdate react method.
View updater.js
var fs = require('fs');
var lineReader = require('readline').createInterface({
input: fs.createReadStream('file.in'),
output: process.stdout,
terminal: false
});
var fd = fs.openSync('file.out', 'w');
fs.write(fd, 'shouldComponentUpdate(nextProps) {\n return (\n');
var lineIt = 0;
@SudoPlz
SudoPlz / AComponent.js
Created Jan 27, 2017
How to deal with react-native-navigation global events (not the best way but it works)
View AComponent.js
/**
* A_Component.js
*/
import { Record } from 'immutable';
import React from 'react';
import * as authActions from '../../state/auth/authActions';
// import * as globalActions from '../../state/global/globalActions';
View My package.json npm scripts
"scripts": {
"debugMode":"parallelshell 'npm run webpack-node' 'npm run webpack-server-browser'",
"start": "parallelshell 'npm run webpack-node' 'npm run webpack-server-browser' 'npm run nodemon'",
"nodemon":"sleep 16;nodemon bin/serverEntryPoint.js",
"webpack-server-browser":"./node_modules/webpack-dev-server/bin/webpack-dev-server.js --config ./webpack.browser.config.js --hot --port 8081",
"webpack-node":"./node_modules/webpack/bin/webpack.js --config ./webpack.node.config.js --progress --watch",
"lint":"eslint app/ -c .eslintrc",
"moveJs":"cp node_modules/marty-clipboard/dist/marty-clipboard.js dist/javascripts/",
@SudoPlz
SudoPlz / commentRemover.js
Last active May 9, 2021
A messy little js file that removes comments from any string passed into `stripComments(str)` function.
View commentRemover.js
exports.stripComments = function stripComments(toBeStrippedStr){
//LEXER
function Lexer () {
this.setIndex = false;
this.useNew = false;
for (var i = 0; i < arguments.length; ++i) {
var arg = arguments [i];
if (arg === Lexer.USE_NEW) {
this.useNew = true;
}