Skip to content

Instantly share code, notes, and snippets.

View semeltheone's full-sized avatar

Thomas semeltheone

  • Karlsruhe, Germany
View GitHub Profile
@semeltheone
semeltheone / acornTest.js
Created March 6, 2018 07:08
Walks all js files in the source directory and finds strings using acorn.
var acorn = require('acorn-jsx');
let fs = require('fs');
function getAllStrings(fileName) {
let file = fs.readFileSync(fileName);
const options = {
sourceType: 'module',
ecmaVersion: 9,
plugins: {
jsx: { allowNamespacedObjects: true },
@semeltheone
semeltheone / knime Batch execute
Last active December 26, 2023 05:13
Knime Execute Workflows from the Commandline
knime.exe -consoleLog -noexit -nosplash -application org.knime.product.KNIME_BATCH_APPLICATION -workflowFile="PathToYourWorkflow.zip" -destFile="OutputPathToYourWorkflow.zip"
g.V("The Shawshank Redemption").In("name").Out(null, "your_favorite_tag_name").All()
@semeltheone
semeltheone / mathematica Cases
Created February 5, 2015 07:21
Find cases using a Condition
l = {{5, 6, 7}, {5, 4, 7}}
Cases[l, {_, x_ /; x > 5, _}]
var Scaffold = React.createClass({
render: function () {
return (
<div>
<nav className="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div className="container">
<div className="navbar-header">
<button type="button" className="navbar-toggle collapsed" data-toggle="collapse"
data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span className="sr-only">Toggle navigation</span>
@semeltheone
semeltheone / groupableTable.html
Created September 26, 2013 05:35
Groupable HTML Table with Bootstrap2
<div class="menu">
<div class="accordion">
<div class="accordion-group">
<div class="accordion-heading country">
<img src="http://placehold.it/100x30" alt="country flag" style="float:left; margin: 3px 10px 0 3px; text-align:center;"/>
<a class="accordion-toggle" data-toggle="collapse" href="#country1">Country</a>
</div>
<div id="country1" class="accordion-body collapse">
<div class="accordion-inner">
<table class="table table-striped table-condensed">
@semeltheone
semeltheone / codeCompletion.py
Created June 6, 2013 05:33
Get code completion for a specific position in a given python file.
from rope.base.project import Project
from rope.contrib.codeassist import code_assist
project = Project('.')
mod1 = project.get_file('mod1.py')
pos = 20
codeCompletions = code_assist(project,mod1.read(),pos+4,resource=None,maxfixes=10)
for cc in codeCompletions:
print cc
@semeltheone
semeltheone / PythonIntrospectionTest
Created May 8, 2013 05:16
Getting the source code and doc comments of a given python function. See http://docs.python.org/2/library/inspect.html for more info about introspection.
from inspect import *
def testFunction(unusedParameter):
"""Test introspection in python.
:param unusedParameter: A unused parameter
"""
a = 'test'
b = a
c = b
return c