Skip to content

Instantly share code, notes, and snippets.

View ljack's full-sized avatar

JarkkoLietolahti ljack

View GitHub Profile
@ljack
ljack / mouth.js
Created March 10, 2016 20:26
code review this
function phrase_action_message (action) {
if (~action.task.name.indexOf('<node.name>')) {
return action.task.name.replace('<node.name>', action.node.name);
}
return action.task.name + ' on ' + action.node.name;
}
@ljack
ljack / react-startbutton.jsx
Last active April 9, 2016 06:38
React button component to simulate start/stop failure scenario
import React from "react";
// React button component to simulate start/stop failure scenario
export default const StartButton = React.createClass({
forward() {
const baseDelay = 4*1000;
switch (this.state.status) {
case 'recovering':
break;
@ljack
ljack / griddle-column-meta.js
Last active April 9, 2016 19:50
GriddleGriddle ColumnMeta's with some custom components
// GriddleGriddle ColumnMeta's with some custom components
export const ColumnMeta = [{
"columnName": "name",
}, {
"columnName": "url",
"displayName": "URL"
}, {
"columnName": "method",
}, {
"columnName": "lastResult",
@ljack
ljack / server.js
Created April 19, 2016 17:33
apimoon wip server
import {
apolloServer
}
from 'graphql-tools';
import express from 'express';
import bodyParser from 'body-parser';
const app = express();
app.use(bodyParser.urlencoded({
extended: true
@ljack
ljack / ButtonsComponent.jsx
Created April 21, 2016 11:16
JSX code beautifier problem
// Component which groups row buttons
export default const ButtonsComponent = React.createClass({
render: function() {
// console.log("ButtonsComponent: render this=", this);
const paddingStyle = {
leftPadding: "5px"
};
return ( < form className = "form-inline"
style = {
paddingStyle
@ljack
ljack / server.py
Created November 7, 2018 07:44
python 3 http server with tail file
from os import listdir,SEEK_END
from os.path import isfile, join, getmtime
from http.server import BaseHTTPRequestHandler, HTTPServer
import socketserver
import time
import subprocess
import select
from urllib.parse import parse_qs,urlparse
import logging
import sys, os, socket