Skip to content

Instantly share code, notes, and snippets.

@hafbau
hafbau / soccer_cuts.py
Created October 4, 2022 08:54 — forked from Zulko/soccer_cuts.py
A python script to automatically summarize soccer videos based on the crowd's reactions
#
# This Python script makes a summary of a football game by cutting
# the video around the 10 % loudest moments, which generally
# include the goals and other important events.
# For more details, see this blog post:
# http://zulko.github.io/blog/2014/07/04/automatic-soccer-highlights-compilations-with-python/
#
# LICENCE: Creative Commons 0 - Public Domain
# I, the author of this script, wave any rights and place this work in the public domain.
#
@hafbau
hafbau / rest_exercise.md
Created June 11, 2020 15:49 — forked from DominicTremblay/rest_exercise.md
Creating routes according to REST

REST exercise

  • You are asked to build an API for a photo app.
  • You need to create the routes according to REST for the following actions:
  1. The end-user wants to see a list of photos

  2. The end-user wants to see a particular photo

@hafbau
hafbau / example_vertical_tabs_react_material_ui.js
Last active December 11, 2022 18:14
Vertical Tabs Example - React Material UI
import React from 'react';
import Tabs from '@material-ui/core/Tabs'
import Tab from '@material-ui/core/Tab'
import Typography from '@material-ui/core/Typography'
import { withStyles } from '@material-ui/core/withStyles';
class ProfileTabs extends React.PureComponent {
state = { activeIndex: 0 }
const createKeyPath = function (currentKeyPath, key) {
return currentKeyPath + (currentKeyPath ? '.' : '') + key;
};
function recursiveObjectKeysPaths(obj, path = '') {
if (!obj || typeof obj == 'string') return;
let keys = [];
let currentPath;
if (Array.isArray(obj)) {