Or: “Everybody likes being given a glass of water.”
By Merlin Mann.
It's only advice for you because it had to be advice for me.
| use strict; | |
| use LWP::UserAgent; | |
| my $app = do { | |
| use Mojolicious::Lite; | |
| get '/' => sub { shift->render(text => "Hello World") }; | |
| get '/search' => sub { | |
| my $self = shift; | |
| my $foo = $self->param('q'); | |
| $self->render(text => "You searched $foo"); |
| #!/bin/bash | |
| # Sync Homebrew installations between Macs via Dropbox | |
| # | |
| BREW="/usr/local/bin/brew" | |
| # first get local settings | |
| echo "Reading local settings ..." | |
| rm -f /tmp/brew-sync.* |
| -- AppleScript -- | |
| -- This example is meant as a simple starting point to show how to get the information in the simplest available way. | |
| -- Keep in mind that when asking for a `return` after another, only the first one will be output. | |
| -- This method is as good as its JXA counterpart. | |
| -- Webkit variants include "Safari", "Webkit", "Orion". | |
| -- Specific editions are valid, including "Safari Technology Preview". | |
| -- "Safari" Example: | |
| tell application "Safari" to return name of front document |
| #!/usr/bin/ruby | |
| # encoding: utf-8 | |
| # | |
| # Updated 2017-10-25: | |
| # - Defaults to large size (512) | |
| # - If ImageMagick is installed: | |
| # - rounds the corners (copped from @bradjasper, https://github.com/bradjasper/Download-iTunes-Icon/blob/master/itunesicon.rb) | |
| # - replace original with rounded version, converting to png if necessary | |
| # | |
| # Retrieve an iOS app icon at the highest available resolution |
| (require 'cl-lib) | |
| ;; Depends on s.el | |
| (defun direnv-data (dir) | |
| ;; TODO: use dir for folder or smart current-project-dir variable | |
| (let ((cmd (concat "$SHELL -i -c '" "cd " dir " && direnv export bash'"))) | |
| (shell-command-to-string cmd))) | |
| ;;(direnv-data "~/src/direnv") | |
| (defun commands-from-direnv (text) |
| #!/bin/bash | |
| # Sync Homebrew installations between Macs via Dropbox | |
| # | |
| BREW="/usr/local/bin/brew" | |
| # first get local settings | |
| echo "Reading local settings ..." | |
| rm -f /tmp/brew-sync.* |
| library(dplyr) | |
| library(ggplot2) | |
| library(lubridate) | |
| library(XML) | |
| #load apple health export.xml file | |
| xml <- xmlParse("C:\\Users\\praskry\\Desktop\\apple_health_data\\export.xml") | |
| #transform xml file to data frame - select the Record rows from the xml file | |
| df <- XML:::xmlAttrsToDataFrame(xml["//Record"]) |
| #!/bin/sh | |
| set -e | |
| ## SEE https://medium.com/@ebuschini/iptables-and-docker-95e2496f0b45 | |
| ## You need to add rules in DOCKER-BLOCK AND INPUT for traffic that does not go to a container. | |
| ## You only need to add one rule if the traffic goes to the container | |
| CWD=$(cd "$(dirname "${0}")"; pwd -P) | |
| FILE="${CWD}/$(basename "${0}")" |
| # Summary | |
| A few notes I took to see if I could use MacOS as Hypevirsor in a similar fashion to Linux | |
| I wanted to see how few addons were needed instead of using Parallels, Virtual Box, VM Fsion etc. | |
| The idea is to use QEMU, Hypervisor Framework (https://developer.apple.com/documentation/hypervisor) and some custom host networking. | |
| # Installations | |
| brew install qemu (For controlling Hypervisor Framework) | |
| brew install cdrtools (For making cloud init iso's) | |
| http://tuntaposx.sourceforge.net/download.xhtml (For customer tap based networking) |