Skip to content

Instantly share code, notes, and snippets.

View SudoPlz's full-sized avatar
💥
shipit

Ioannis Kokkinidis SudoPlz

💥
shipit
View GitHub Profile
@SudoPlz
SudoPlz / commentRemover.js
Last active December 15, 2023 07:08
A messy little js file that removes comments from any string passed into `stripComments(str)` function.
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;
}
"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 / AComponent.js
Created January 27, 2017 10:57
How to deal with react-native-navigation global events (not the best way but it works)
/**
* 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';
@SudoPlz
SudoPlz / updater.js
Created June 6, 2017 20:05
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.
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 / file.in
Last active June 6, 2017 20:07
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.
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,
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) {
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
import _ from 'underscore';
export default class HoldList {
constructor() {
this.holdList = [];
this.runningRequestCnt = 0;
}
invokeAll(err, exclude) {
package com.acuityscheduling.app.android.Calendar.React;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.uimanager.ShadowNodeRegistry;
import com.facebook.react.uimanager.ThemedReactContext;
import com.facebook.react.uimanager.UIImplementation;
import com.facebook.react.uimanager.UIManagerModule;
import com.facebook.react.uimanager.ViewManager;