Skip to content

Instantly share code, notes, and snippets.

View MartinMuzatko's full-sized avatar
🐈

Martin Muzatko MartinMuzatko

🐈
View GitHub Profile
@MartinMuzatko
MartinMuzatko / SassMeister-input.scss
Last active May 18, 2016 08:24
Flexproperties - ~4053 Lines
// ----
// Sass (v3.4.21)
// Compass (v1.0.3)
// ----
$breakpoints: (
(sm, 600px)
(md, 960px)
(lg, 1200px)
);
@MartinMuzatko
MartinMuzatko / fn.js
Created June 30, 2016 11:47
Finding multiple occurences of string and highlight them
(find, content) => {
// EXAMPLE
// find = 'route found'
// content = 'we found, that routes are commonly misinterpreted'
// return: 'we <b>found</b>, that <b>route</b>s are commonly misinterpreted'
var searchQueries = find.toLowerCase().split(' ')
// highlight all parts of strings that were found
for (var searchQuery in searchQueries) {
searchQuery = searchQueries[searchQuery]
if (!!~content.toLowerCase().indexOf(searchQuery)) {
// Part of a class
apply(compiler) {
compiler.plugin('emit', (compilation, callback) => {
this.valid = true
for (var filename in compilation.assets) {
if (this.valid) {
this.upload(filename, filename.replace(compilation.options.theme, ''))
}
}
console.log('upload done');
@MartinMuzatko
MartinMuzatko / webcam.js
Created November 17, 2016 15:17
WebRTC Instant Webcam
navigator.mediaDevices.getUserMedia({audio:0,video:1})
.then(function(mediaStream) {
document.body.innerHTML='<video>'
var video = document.querySelector('video')
video.srcObject = mediaStream
video.onloadedmetadata = function(e) {
video.play()
}
})
@MartinMuzatko
MartinMuzatko / gist:8c68af1eb7aaccf92ceda4b23a639c1f
Created December 9, 2016 10:14
DE Description of Processwire
  1. ProcessWire ProcessWire hat viele Anwendungen. Man verwendet ein existierendes framework als Grundlage um ein eigenes System zu erschaffen. CMF - Content Management Framework statt CMSystem. Das kann aber in alle Richtungen gehen:

     Blog
     Shop
     Eventsystem
     Booking
     jede WebApp (With ProcessWire as Backend)
    

Man bestimmt per Oberfläche eigene Datentypen (Felder). Welche in Templates wieder verwendet werden.

@MartinMuzatko
MartinMuzatko / example.js
Created January 20, 2017 15:14
GET Params in JS as Object
// location.search = '?a=b&c=d&limit=20'
var get = new Map(location.search.substr(1).split('&').map((pair)=>{return pair.split('=')}))
// get = {a:'b', c:'d', limit: 20}
var webpack = require('webpack')
var ExtractTextPlugin = require("extract-text-webpack-plugin")
var path = require('path');
module.exports = {
entry: "./src/index.js",
output: {
path: path.resolve(__dirname, ''), // string
filename: "[name].js", // string
function rot(text, amount=13) {
return text.split('').map(letter=>{return String.fromCharCode(((letter.charCodeAt(0)-97+amount) % 25) + 97)}).join('')
}