Skip to content

Instantly share code, notes, and snippets.

View nanoant's full-sized avatar

Adam Strzelecki nanoant

View GitHub Profile
@nanoant
nanoant / icget.swift
Created August 13, 2019 17:50 — forked from anongit/icget.swift
Download .icloud files
// See: https://apple.stackexchange.com/questions/328329/is-there-a-way-via-the-command-line-to-cause-icloud-files-to-download
import Foundation
func main() {
let fm = FileManager.default
for path in CommandLine.arguments[1...] {
let url = NSURL.fileURL(withPath: path)
guard fm.fileExists(atPath: url.path) else {
@nanoant
nanoant / pre-receive
Last active December 10, 2015 19:35 — forked from iley/pre-receive
pre-receive hook to deny pushing big files
#!/usr/bin/perl -wl
use strict;
my $limit = 20 * 1024 * 1024;
my $hasBadFiles;
# human friendly sizes
sub hsize {
# http://www.perlmonks.org/?node_id=378580
(sort { length $a <=> length $b } map { sprintf '%.2g %s',