Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

# Place this file in the same directory as `Vagrantfile'
# then simply require "vagrant-snapshot.rb" at the top of Vagrantfile.
require 'optparse'
Vagrant.commands.register(:snap) { Snap::Commands }
# Provide rake-like desc() 'inflected' documentation
# See http://stackoverflow.com/questions/2948328/access-attributes-methods-comments-programmatically-in-ruby
class Module
@olegwtf
olegwtf / gist:c9c5a266352cba73dc5b
Last active January 20, 2018 09:58
Mojo::UserAgent progress bar
BEGIN { $ENV{MOJO_MAX_MESSAGE_SIZE} = 1024**3 }
use strict;
use Mojo::UserAgent;
$| = 1;
my $ua = Mojo::UserAgent->new;
$ua->on(start => sub {
my ($ua, $tx) = @_;
#!/bin/sh
die () {
msg="$1\n"
shift
printf "$msg" "$@" 1>&2
exit 1
}
use=`
@vadviktor
vadviktor / etc.fstab
Last active February 3, 2019 09:08
Ubuntu guest VMware shared folders using open-vm-tools package and vmhgfs-fuse
.host:/vmshared /mnt/vmshared fuse.vmhgfs-fuse allow_other,uid=1000,gid=1000,auto_unmount,defaults 0 0
@creaktive
creaktive / mojo-crawler.pl
Last active November 28, 2020 13:15
Simple web crawler/scraper implemented using Mojolicious
#!/usr/bin/env perl
use 5.010;
use open qw(:locale);
use strict;
use utf8;
use warnings qw(all);
use Mojo::UserAgent;
# FIFO queue
@stuby
stuby / rPrint example.txt
Created April 23, 2013 17:54
This is a handy recursive data printer.
> rPrint({first={true,1.3,"abc",{1,2,5}},22,33,last={nil,5},2},nil,"Junk")
Junk table
Junk [1] number 22
Junk [2] number 33
Junk [3] number 2
Junk [last] table
Junk [last] [2] number 5
Junk [first] table
Junk [first] [1] boolean true
Junk [first] [2] number 1.3
@armadsen
armadsen / openssl-build.sh
Last active April 17, 2022 22:14 — forked from Norod/openssl-build.sh
A shell script to build openssl for iOS and Mac. >>>>> It currently builds: Mac (i386, x86_64) >>>>> iOS (armv7, arm64) >>>>> iOS Simulator (i386, x86_64) >>>>> Updated to work with Xcode 7 and produce bitcode enabled binaries >>>>> Minimum deployment target can be easily configured
#!/bin/bash
# This script builds the iOS and Mac openSSL libraries with Bitcode enabled
# Download openssl http://www.openssl.org/source/ and place the tarball next to this script
# Credits:
# https://github.com/st3fan/ios-openssl
# https://github.com/x2on/OpenSSL-for-iPhone/blob/master/build-libssl.sh
# Peter Steinberger, PSPDFKit GmbH, @steipete.
# Doron Adler, GlideTalk, @Norod78
@jberger
jberger / URLQueue.pl
Last active November 10, 2022 20:58
Modularization of my answer from SO on URL queuing for non-blocking ua
#!/usr/bin/env perl
package Mojo::URLQueue;
use Mojo::Base 'Mojo::EventEmitter';
use Mojo::UserAgent;
has queue => sub { [] };
has ua => sub { Mojo::UserAgent->new(max_redirects => 5) };
has concurrency => 4;
@rdbox
rdbox / etc.fstab
Last active June 25, 2023 04:21
Ubuntu guest VMware shared folders vmhgfs-fuse
# Данные Команды добавляют в автозагрузку shared folders VMware
# Вариант 1.
a. Install open-vm-tools, apt-get install open-vm-tools.
b. Install open-vm-tools-dkms, apt-get install open-vm-tools-dkms.
c. Run /usr/bin/vmware-hgfsclient, it will display your shared folder.
d. Update your /etc/fstab using the details below:
@RobFreiburger
RobFreiburger / removeOffice2011.sh
Created June 16, 2011 04:51
Office 2011 for Mac Uninstaller
#!/bin/sh
# Credit to http://www.officeformachelp.com/office/install/remove-office/
osascript -e 'tell application "Remote Desktop Connection" to quit'
osascript -e 'tell application "Microsoft Document Connection" to quit'
osascript -e 'tell application "Microsoft Messenger" to quit'
osascript -e 'tell application "Microsoft Communicator" to quit'
osascript -e 'tell application "Microsoft Outlook" to quit'
osascript -e 'tell application "Microsoft Excel" to quit'