20. 11. 2020

Create macOS Big Sur ISO Image File

First download macOS Big Sur From Apple with App Store. Quit installator with ⌘+q, then create new empty volume:

sudo hdiutil create -o /tmp/BigSur -size 16384m -volname BigSur -layout SPUD -fs HFS+J

Mount new volume:

sudo hdiutil attach /tmp/BigSur.dmg -noverify -mountpoint /Volumes/BigSur

Create bootable dmg and copy to new volume:

sudo /Applications/Install\ macOS\ Big\ Sur.app/Contents/Resources/createinstallmedia --volume /Volumes/BigSur --nointeraction

Eject installator:

hdiutil eject -force /Volumes/Install\ macOS\ Big\ Sur

Convert dmg to cdr file:

hdiutil convert /tmp/BigSur.dmg -format UDTO -o ~/Downloads/BigSur

Rename cdr to iso:

mv -v ~/Downloads/BigSur.cdr ~/Downloads/BigSur.iso

Delete original created dmg file:

sudo rm -fv /tmp/BigSur.dmg

#macOS

12. 11. 2020

Retrieve IP adress of AirPrint Printer

You can use ippfind command that finds services registered with a DNS server or available through local devices. Its primary purpose is to find IPP printers and show their URIs, show their current status, or run commands.

ippfind

Then you get local adress of printer (Internet Printing Protocol (IPP, RFC 2911)):

ipp://3036B5000000.local:XXX/ipp/print

then ping local address

ping 3036B5000000.local

and here we go

PING 3036B5000000.local (192.168.0.108): 56 data bytes
64 bytes from 192.168.0.108: icmp_seq=0 ttl=64 time=262.342 ms
64 bytes from 192.168.0.108: icmp_seq=1 ttl=64 time=285.290 ms

our printer has 192.168.0.108

#macOS

1. 11. 2020

November 2020

Tools

  • dog is a command-line DNS client.
  • Yarn.BUILD
  • Carbon - Create and share beautiful images of your source code.
  • Shiki - Shiki is a beautiful Syntax Highlighter. Demo.

Design

  • No Design DEV - A collection of tools for developers who have little to no artistic talent.
  • SVGBox - SVGBox makes it dead-easy to include icons in your project. Simple <img> tags
  • SimpleIcons - 1463 Free SVG icons for popular brands

Life

  • Veloretti - Lightweight, handmade in Europe, a damn good design and no fuss.
  • Dafilms - documentary movies online

IOT

  • ROCK Pi 4 - single board computer with M.2 connector supports up to 2T M.2 NVME SSD

#notices

20. 10. 2020

CSS frameworks

Full frameworks

  • Tailwind CSS - a utility-first CSS framework for rapidly building custom designs.
  • Twitter Boostrap - world’s most popular front-end open source toolkit
  • Bulma - Bulma is a free, open source CSS framework based on Flexbox
  • UIKit - Lightweight and modular front-end framework

Minimalist

  • MVP.css - A minimalist stylesheet for HTML elements
  • Picni.css - Lightweight and beautiful CSS library

#css #webdesign

16. 10. 2020

Add a Class to the First Post in The Loop

add_filter(
    'post_class', 
    function ( $classes ) {
        global $wp_query;
        if( 0 == $wp_query->current_post )
            $classes[] = 'first';
        return $classes;
    }
);

#Wordpress #PHP

12. 10. 2020

Awesome Markdown editors

Typora

I am just found the best (for me) Markdown editor on the planet. Why?

  • it's freeware and opensource
  • it's minimalistic and easy to use
  • combine wysiwyg and plaintext editing
  • support folders, front matter, custom styles,
  • allow quick file open ⌘ + ⇧ + O 😍
brew cask install typora

Caret

Caret is a Markdown editor for Mac, Windows and Linux. It stands out with its clean interface, productivity features and obsessive attention to detail. ($29)

brew cask install caret

Notable

Markdown note taking app supports tags, dark theme, zen mode, multi edit and so on

brew cask install notable

MacDown

Open source Markdown editor inspired by Mou, with live preview of extended markdown syntaxes

brew cask install macdown

Visual Studio Code

brew cask install visual-studio-code

#markdown #macOS

6. 10. 2020

HTML Skeleton

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8" />
  <title></title>
  <meta name="description" content="" />
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
  <meta name="author" content="" />

  <!-- OG -->
  <meta property="og:title" content="" />
  <meta property="og:site_name" content="" />
  <meta property="og:description" content="" />
  <meta property="og:image" content="" />
  <meta property="og:url" content="" />

  <!-- Twitter card -->
  <meta name="twitter:card" content="summary_large_image" />
  <meta name="twitter:image:alt" content="image description" />

  <!-- Sitemap & RSS feed -->
  <link rel="sitemap" type="application/xml" title="Sitemap" href="/sitemap.xml"/>
  <link rel="alternate" type="application/rss+xml" title="RSS" href="/rss.xml"/>

  <!-- Tailwind -->
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/tailwindcss/1.8.10/tailwind.min.css" integrity="sha512-KO1h5ynYuqsFuEicc7DmOQc+S9m2xiCKYlC3zcZCSEw0RGDsxcMnppRaMZnb0DdzTDPaW22ID/gAGCZ9i+RT/w==" crossorigin="anonymous" />
  <link href="style.css" rel="stylesheet" />

  <!-- Favicon -->
  <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
</head>
<body class="font-sans text-gray-900 leading-normal tracking-normal grid min-h-screen">
  <header></header>
  <main class="grid items-center"></main>
  <footer></footer>
  <script src="app.js" async></script>
</body>
</html>

With:

#HTML #Snippets

2. 10. 2020

Yarn tips and tricks

Chose Yarn version

Let’s find out your current Yarn version with yarn --version. If your local Yarn version is 1.22 and above go ahead and type-in:

yarn set version berry

This should fetch Yarn 2 and show you an output as follows:

Resolving berry to a url...
Downloading https://github.com/yarnpkg/berry/raw/master/packages/berry-cli/bin/berry.js...
Saving it into /Volumes/Work/web/.yarn/releases/yarn-berry.cjs...
Updating /Volumes/Work/web/.yarnrc.yml...
Done!

You can downgrade back with follow:

yarn set version 1.22.5

Upgrade all npm packages interactively

This is similar to npm-check interactive update mode. It provides an easy way to update outdated packages

yarn upgrade-interactive --latest 

Will looks like follow:

[1/? Choose which packages to update. (Press <space> to select, <a> to toggle all, <i> to inverse selection)

 devDependencies
❯◯ autoprefixer      6.7.7  ❯  7.0.0          https://github.com/postcss/autoprefixer#readme
 ◯ webpack           2.4.1  ❯  2.5.1          https://github.com/webpack/webpack

 dependencies
 ◯ bull              2.2.6  ❯  3.0.0-alpha.3  https://github.com/OptimalBits/bull#readme
 ◯ fs-extra          3.0.0  ❯  3.0.1          https://github.com/jprichardson/node-fs-extra
 ◯ socket.io         1.7.3  ❯  1.7.4          https://github.com/socketio/socket.io#readme
 ◯ socket.io-client  1.7.3  ❯  1.7.4          https://github.com/Automattic/socket.io-client#readme

Offline package mirrors

Yarn can maintain offline copies of your packages for more repeatable and reliable build. Create .yarnrc file with follow content:

yarn-offline-mirror "./.npm"
yarn-offline-mirror-pruning true
--install.prefer-offline true
--install.dev true

All npm packages will be saved to .npm folder locally.

#yarn #npm #javascript