Skip to content

Instantly share code, notes, and snippets.

View martinnov92's full-sized avatar
🎯
Focusing

Martin Novák martinnov92

🎯
Focusing
View GitHub Profile
  1. Open Automator.app
  2. Create new Quick Action
  3. Select Run AppleScript
  4. Add this:
set inputVolume to input volume of (get volume settings)
if inputVolume = 0 then
	set inputVolume to 100
	display notification "Volume set to 100" with title "✅ Microphone is on"
@martinnov92
martinnov92 / ukazka.json
Last active December 3, 2017 09:51 — forked from pufinek/ukazka.json
{
"test": {
"title": "Martin - ukázka",
"description": "Státní maturita 2010.",
"cermat": true,
"tasks": [
{
"title": "Martin S04",
"taskText": "&&\\images\\tasks\\S02T05P03\\S02T05P03.jpg&&",
"question": "Odpoved Ano / Ne",
@martinnov92
martinnov92 / what-forces-layout.md
Created November 15, 2017 10:42 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Element

Box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
  • elem.clientLeft, elem.clientTop, elem.clientWidth, elem.clientHeight
  • elem.getClientRects(), elem.getBoundingClientRect()
@martinnov92
martinnov92 / .gitlab-ci.yml
Created October 25, 2017 19:02
GitLab CI yml file for deploying Node.js app to heroku
stages:
- deploy
before_script:
- apt-get update -qy
staging:
image: ruby:2.3
stage: deploy
script:
{
"test": {
"title": "Testovací test",
"tasks": [
{
"title": "Testovací úkol",
"maxPoints": 2
},
{
@martinnov92
martinnov92 / ParseTimeDuration.md
Last active September 22, 2017 12:25
JavaScript function for parsing (string) time value (1d 12h 25m)
function parseDuration(text)  {
    let m;
    let result = 0;
    
    if (m = text.match(/(\d+)s/)) {
        result += m[1];
    }
    
 if (m = text.match(/(\d+)m/)) {
@martinnov92
martinnov92 / mac.md
Last active November 26, 2017 06:24
MacOS tips and tricks

MacOS tips and tricks

Save Terminal command to alias:
alias NAME=cd Documents/...

Get information about alias:
type NAME

Source

@martinnov92
martinnov92 / windows.md
Last active July 28, 2017 07:08
Windows tips and tricks

Windows tips and tricks

Generate battery report

powercfg /batteryreport /output "C:\battery_report.html"

Record screen

Open Xbox app (Windows 10) and then in app which you would like to record hit ALT+WIN+R

  • When there is an error with CSSProperties (position: 'absolute' - type string does not match type 'absolute'), use position: 'absolute' as 'absolute'
@martinnov92
martinnov92 / Readme.md
Last active June 29, 2017 18:49
GET XMLHttpRequest wrapped in Promise

GET XMLHttpRequest wrapped in Promise