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 / 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 / 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';
"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 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;
}