sudo apt install \
autoconf \
bison \
To trick OneDrive in backing up TimeMachine's backup, we use a SparseBundle filesystem (explorable) image/file, as it supports differential upload.
The partition of the SSD (that contains the backup as a file) is symlinked inside the OneDrive folder (using fstab
) so its content (the sparsebundle) gets synced AND is actually stored on the SSD partition (without taking space on the machine).
Create a TimeMachine.sparsebundle first, using Disk Utility:
- set filesystem to Journaled HFS+ - Mac OS Extended (Journaled) (NOT Case-Sensitive)
- choose "sparse bundle" as image-format
- use a GUID partition map
- give name "TimeMachineMac10" (is the mounting name, it will be used below from tmutil-setdestination!)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Int <--> Boolean | |
fun Boolean.toInt() = if (this) 1 else 0 | |
fun Int.toBoolean() = if (this == 0) 0 else 1 | |
// Int <--> Binary bit | |
fun Int.toBit() = this.mod(2).toBoolean().toInt() | |
fun Int.toBinaryString() = this.toString(2) | |
fun Int.toPaddedBinaryString() = this.toString(2).padStart(Int.SIZE_BITS, '0') | |
fun Int.toXaryString(baseX: Int) = this.toString(baseX) |
http://martinfowler.com/books/refactoring.html
Five or six years ago I was working on an essay about refactoring CSS. I didn't do that, but I did find these notes while working on something new. Hope they're useful! —Dean
p7 "When you find you have to add a feature to a program, and the program's code is not structured in a convenient way to add the feature, first refactor the program to make it easy to add the feature, then add the feature."
p7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RUN apt update | |
RUN apt upgrade -y | |
RUN apt install -y apt-utils | |
RUN a2enmod rewrite | |
RUN apt install -y libmcrypt-dev | |
RUN docker-php-ext-install mcrypt | |
RUN apt install -y libicu-dev | |
RUN docker-php-ext-install -j$(nproc) intl | |
RUN apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng12-dev | |
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Youtube Fucookies | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Fuck off Youtube attempts to get your cookies. Press "Y" for going to /embed page and just watch the damn thing. | |
// @author Igor Pellegrini | |
// @include /^https?\:\/\/.*youtube\..*\/.*\?.*v=[^&]+.*$/ | |
// @grant GM_log | |
// ==/UserScript== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# remove exited containers: | |
docker ps --filter status=dead --filter status=exited -aq | xargs -r docker rm -v | |
# remove unused images: | |
docker images --no-trunc | grep '<none>' | awk '{ print $3 }' | xargs -r docker rmi | |
# remove unused volumes (needs to be ran as root): | |
find '/var/lib/docker/volumes/' -mindepth 1 -maxdepth 1 -type d | grep -vFf <( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name remove-google-ads | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Remove ADs fake-search-results on Google SRP | |
// @author Igor Pellegrini | |
// @include /^https?\:\/\/.*.google\..*\/search.*$/ | |
// @grant GM_log | |
// ==/UserScript== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Increment a version string using Semantic Versioning (SemVer) terminology, and adds it to git-tags | |
# - Customised from: https://github.com/fmahnke/shell-semver/blob/master/increment_version.sh) | |
# INSTALL: put the script in a PATH directory. 'git' will recognize automatically the new command. | |
# USAGE: "git tag++ -p" | |
# "git tag++ -Mp" | |
# BEWARE: "git describe" returns the last-tag JUST for the current tree! | |
# if amend a commit the SHA will change and the eventual tag will still point to the old unchanged commit |
- input parameters are the input in the querystring. extraParams dunno yet. usedParams are the params provided to url generation method.
- agavi doesn't filter the just valid parameters; if you add &foo=bar it will end in the result of gen(nullRoute)
-
- (any parameter to just pass the validated parameters?)
- AgaviWEBrouting encodes with rawurlencode by default (to test it try to create an AgaviRoutingValue with routing->createValue. One of the params should be to explicitly choose encoding or not.
- fillGenNullParameters() returns getMatchedParameters(), that are the $url_params passed to routing->gen(route, url_params)
E.g.
{"firstchar":"a","baseSearch":"ricerca","baseVenue":"luoghi","basePath":"\/it\/biglietti"}