Skip to content

Instantly share code, notes, and snippets.

View theroka's full-sized avatar

theroka theroka

  • Vodafone Deutschland
  • Berlin
View GitHub Profile
IMyTerminalBlock doorIn;
IMyTerminalBlock doorOut;
IMyAirVent vent;
public Program() {
Runtime.UpdateFrequency = UpdateFrequency.Update100;
doorIn = GridTerminalSystem.GetBlockWithName("Door In Portside Lock") as IMyTerminalBlock;
doorOut = GridTerminalSystem.GetBlockWithName("Door Out Portside Lock") as IMyTerminalBlock;
vent = GridTerminalSystem.GetBlockWithName("Air Vent Portside Lock") as IMyAirVent;
}
@theroka
theroka / scaffold.sh
Last active November 5, 2019 14:40
Scaffold web development project with Git+Github.com, Babel, Gulp, Browserify, React/Redux/Reselect.
DEFAULT_AUTHOR="your-author-name"
DEFAULT_EMAIL="[email protected]"
DEFAULT_VERSION="1.0.0"
DEFAULT_GITHUB_USER="your-github-user"
echo "\nHello.\n"
currentDir=$(pwd)
echo "Current dir: ${currentDir}"
@theroka
theroka / open.go
Last active October 24, 2019 13:07
Open browsers with golang.
package main
import (
"context"
"fmt"
"html/template"
"net/http"
"os"
"os/signal"
"sync"
@theroka
theroka / DebouncedInput.jsx
Created July 29, 2019 14:08
Functional React component for debounced text input.
const initialState = { value: null, debounce: null };
const DebouncedInput = ({ onChange, placeholder, timeout = 500 }) => {
let [ state, setState ] = React.useState(initialState);
const handleChange = (evt) => {
let value = evt.target.value;
if (state.debounce) clearTimeout(state.debounce);
let debounce = null;
@theroka
theroka / destructuring.js
Created November 3, 2017 08:45 — forked from mikaelbr/destructuring.js
Several demos and usages for ES6 destructuring. Runnable demos and slides about the same topic: http://git.mikaelb.net/presentations/bartjs/destructuring
// === Arrays
var [a, b] = [1, 2];
console.log(a, b);
//=> 1 2
// Use from functions, only select from pattern
var foo = () => [1, 2, 3];
@theroka
theroka / README.md
Last active August 29, 2015 14:02
CSS Clearfix

CSS Clearfix

  • for all major browsers
  • IE6/7 should be supported (not tested)
  • written in LESS
  • use it as mixin
@theroka
theroka / APIFEST
Last active August 29, 2015 14:01
Concatenate API Blueprints and render with danielgtaylor/aglio
endpoint1.md
endpoint2.md
endpoint3.md
namespace :minifier do
JAR = "/Users/blanders/MyDocs/Library/yuicompressor.jar"
def minify(files)
files.each do |file|
next if file =~ /\.min\.(js|css)/
minfile = file.sub(/\.js$/, ".min.js").sub(/\.css$/, ".min.css")
cmd = "java -jar #{JAR} #{file} -o #{minfile}"