Skip to content

Instantly share code, notes, and snippets.

View fuglu's full-sized avatar

Benjamin Kluck fuglu

View GitHub Profile
@fuglu
fuglu / reject.py
Last active August 1, 2016 02:59
python3 sipgate.io server
#!/usr/bin/env python3.4
from http.server import BaseHTTPRequestHandler, HTTPServer
import urllib.parse
import logging
from xml.dom.minidom import Document
logging.basicConfig(level=logging.DEBUG)
class MegaAwesomePythonServer(BaseHTTPRequestHandler):
import React from 'react';
import { connect } from 'react-redux';
import { actions as historyActions } from 'redux/modules/history';
export default (WrappedComponent) => {
class HistoryContainer extends React.Component {
static propTypes = {
fetchHistory: React.PropType.func.isRequired,
}
componentWillMount() {
git pull
yarn
yarn start
yarn storybook
editor src/components/MyComponent.*jsx
git commit -am "Awesome new feature or maybe a bugfix"
git push origin master
@fuglu
fuglu / Code.gs
Last active November 12, 2019 10:56
Google Spam Filter
function spamFilter() {
var threads = GmailApp.search('is:unread in:inbox');
for (var i = 0; i < threads.length; i++) {
var thread = threads[i];
if (!thread.isUnread()) {
continue;
}
@fuglu
fuglu / typescript-dependency-bootstrap.sh
Created November 27, 2019 19:15
Bootstrap TypeScript Development Tools
#/bin/sh
npm install --save-dev \
typescript \
ts-node-dev \
eslint \
@typescript-eslint/eslint-plugin \
@typescript-eslint/parser \
prettier \
eslint-config-prettier \
@fuglu
fuglu / Dockerfile.nodejs
Created December 6, 2019 11:50
Basic Node.js Dockerfile
FROM node:lts-alpine AS builder
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run test
RUN npm run build
FROM node:lts-alpine
ENV NODE_ENV=production
var msg = {};
msg.payload = {
value_id: "2-37-1-0",
node_id: 2,
class_id: 37,
type: "bool",
genre: "user",
instance: 1,
index: 0,
label: "Switch",
@fuglu
fuglu / docker-compose.yml
Created July 5, 2021 16:13
Single node Elasticsearch cluster
version: "3.4"
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.13.2
ports:
- 9200:9200
- 9300:9300
environment:
- discovery.type=single-node