Skip to content

Instantly share code, notes, and snippets.

View themasch's full-sized avatar

Mark Schmale themasch

View GitHub Profile
proxy_cache_path /var/cache/nginx/npm_cache levels=1:2 keys_zone=npm_cache:10m;
upstream npm_registry {
server registry.npmjs.org:443;
}
server {
listen 80;
server_name blblabla;
@themasch
themasch / amdshim.js
Last active September 18, 2018 08:58
UI5 AMD shim?
function define (req, factory) {
if (typeof req === 'function') {
factory = req
req = []
}
return sap.ui.define(req, factory, true)
}
define.amd = true
@themasch
themasch / example.js
Created May 8, 2018 16:14
example that creates a incorrect warning in webstorm/phpstorm
define(['./Object'], function (BaseObject) {
"use strict";
/**
* @class some cool class
*
* @abstract
* @public
* @alias demo.AbstractClass
*/
#!/usr/bin/env bash
set -Eeuo pipefail
function setup_pgpass_file {
echo -n "" > ~/.pgpass
chmod 600 ~/.pgpass
}
function backup_database {
@themasch
themasch / local_db.sh
Created April 19, 2018 09:43
start & stop a local dynamodb for fun and profit
#!/usr/bin/env bash
set -e
function install_dynamodb_local {
if [ ! -e "db/DynamoDBLocal.jar" ]; then
echo "Downloading DynamoDBLocal"
mkdir -p db && cd db
curl "https://s3.eu-central-1.amazonaws.com/dynamodb-local-frankfurt/dynamodb_local_latest.tar.gz" -s | tar -xz
cd ..
error[E0277]: the trait bound `errors::Error: storage::_IMPL_DESERIALIZE_FOR_User::_serde::export::From<std::sync::PoisonError<std::sync::MutexGuard<'_, rocksdb::DB>>>` is not satisfied
--> src/storage.rs:28:15
|
28 | match self.db.lock()?.get(format!("user:{}", username).as_bytes()) {
| ^^^^^^^^^^^^^^^ the trait `storage::_IMPL_DESERIALIZE_FOR_User::_serde::export::From<std::sync::PoisonError<std::sync::MutexGuard<'_, rocksdb::DB>>>` is not implemented for `errors::Error`
|
= help: the following implementations were found:
<errors::Error as storage::_IMPL_DESERIALIZE_FOR_User::_serde::export::From<std::num::ParseIntError>>
<errors::Error as storage::_IMPL_DESERIALIZE_FOR_User::_serde::export::From<std::io::Error>>
<errors::Error as storage::_IMPL_DESERIALIZE_FOR_User::_serde::export::From<chrono::ParseError>>
#!/bin/bash
declare -A deployTo
deployTo[development]="/home/masch/gitdeploy/dev"
deployTo[master]="/home/masch/gitdeploy/prod"
gitDir="/home/masch/gitdeploy/deploy.git"
function deploy() {
branch=$1
function createElement(definition) {
var attributes = definition.attributes
if (typeof definition.elementName !== 'string') {
var Class = definition.elementName
if (Class.getMetadata) {
var oMetadata = Class.getMetadata()
var sDefaultAggregation = oMetadata._sDefaultAggregation
if (typeof sDefaultAggregation === 'string') {
function Item(props) {
return <li>{props.message}</li>;
}
function TodoList() {
const todos = ['finish doc', 'submit pr', 'nag dan to review'];
return (
<ul>
{todos.map((message) => <Item key={message} message={message} />)}
</ul>

Keybase proof

I hereby claim:

  • I am themasch on github.
  • I am masch (https://keybase.io/masch) on keybase.
  • I have a public key ASCcZG3NKRRGoIZ7R_WAX4kvV3SSGrq2JLHGOfcdsbqotgo

To claim this, I am signing this object: