Skip to content

Instantly share code, notes, and snippets.

View mstaack's full-sized avatar
🎯
Focusing

Max mstaack

🎯
Focusing
View GitHub Profile
<table class="table table-hover table-condensed">
<thead>
<tr>
<th>Name</th>
<th>Date</th>
<th>Size</th>
<th>Type</th>
</tr>
</thead>
<tbody>
<template>
<tr class="item-row" @contextmenu.prevent="deletePath(item)">
<td>
<i class="fa fa-fw" :class="getIcon(item)" aria-hidden="true"></i>
<a href='#' @click="openItem(item)"> {{ item.filename }}{{item.extension ? '.' + item.extension : '' }}</a>
</td>
<td> {{ createdOn(item) }}</td>
<td> {{ item.size }}</td>
<td> {{ item.type }}</td>
</tr>
@mstaack
mstaack / gist:b6bc319f10cad4d27fb63529307e2915
Created April 13, 2017 11:40
quasar nested linkstoolbar
<q-drawer-link icon="content_paste" to="/app" exact>
Dashboard
</q-drawer-link>
<q-drawer-link icon="assignment" to="/app/registrations">
Registrations
</q-drawer-link>
<q-collapsible menu icon="event" label="Event" opened>
<q-drawer-link to="/app/event">
Data
</q-drawer-link>
//diy webradio with atmega328 & carambola2 board by m.staack
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <SoftwareSerial.h>
#include <Encoder.h>
#include <EEPROM.h>
#include <SPI.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
/**
* Crazy tree building
*
* @param \Illuminate\Support\Collection $folders
*
* @return array
*/
public function createTree(\Illuminate\Support\Collection $folders)
{
$folders = $folders->toArray();
@mstaack
mstaack / readme.md
Created July 18, 2017 21:15 — forked from endolith/readme.md
How to stream a webcam to a web browser in Ubuntu

Grr this took hours to figure out. I was trying to install MJPG-streamer and running VLC command lines and all this crap but nothing worked.

First install motion:

~> sudo apt-get install motion

Then create a config file:

~> mkdir ~/.motion

~> nano ~/.motion/motion.conf

@mstaack
mstaack / array_transform.php
Created August 2, 2017 19:59
array transform
<?php
$mailFolders = [
'INBOX',
'INBOX.childfolder',
'INBOX.childfolder.subchildfolder',
'INBOX.sent',
'INBOX.draft'
];
@mstaack
mstaack / index.html
Created October 4, 2017 12:17
uikit3 - gallery
<!--HEADER-->
<header>
<nav class="uk-navbar-container">
<div class="uk-container">
<div class="uk-navbar">
<div class="uk-navbar-left">
<a class="uk-navbar-item uk-logo" href="#">Logo</a>
</div>
<div class="uk-navbar-center">
@mstaack
mstaack / Application.php
Last active October 7, 2017 10:05 — forked from deividaspetraitis/Application.php
Lumen Custom Request
<?php namespace App;
class Application extends \Laravel\Lumen\Application
{
use Concerns\RoutesRequests; // override with our new trait
}
@mstaack
mstaack / assignSlots.sh
Created October 12, 2017 10:02 — forked from jpe42/assignSlots.sh
Evenly assign slots to a new Redis Cluster
#!/bin/bash
#./assignSlots.sh 7001 5 redis-cluster-m-
readonly STARTING_PORT=${1:-0}
readonly NUM_MASTERS=${2:-0}
readonly NAME_PREFIX=${3:-"redis-cluster-m-"}
readonly MAX_SLOT=$((16383))
readonly SLOT_RANGE=$(((MAX_SLOT + NUM_MASTERS - 1) / NUM_MASTERS))
readonly LOCAL_CONTAINER_ID=$(docker ps -f name="$NAME_PREFIX" -q | head -n 1)
readonly LOCAL_PORT=$(docker inspect --format='{{index .Config.Labels "com.docker.swarm.service.name"}}' "$LOCAL_CONTAINER_ID" | sed 's|.*-||')
for ((port = STARTING_PORT, endPort = STARTING_PORT + NUM_MASTERS, slot = 0; port < endPort; port++)) do