Skip to content

Instantly share code, notes, and snippets.

View asendra's full-sized avatar

Alberto Sendra asendra

View GitHub Profile
#!/bin/bash
VM=$1
size=`sudo lvs -o lv_size --unit=b --noheadings /dev/vg_vms/ubuntu-base-vm | sed 's/^ *//'`
echo size=$size
sudo lvcreate --size=$size --name=vms-$VM vg_vms
sudo virt-resize --expand sda1 \
/dev/vg_vms/ubuntu-base-vm /dev/vg_vms/vms-$VM
mkdir -p tmp
virsh dumpxml ubuntu-base-vm > tmp/ubuntu-base-vm.xml
@interface UIView (Bryan)
- (void)updateFrame:(void (^)(CGPoint *origin, CGSize *size))block;
@end
@implementation UIView (Bryan)
- (void)updateFrame:(void (^)(CGPoint *origin, CGSize *size))block {
CGRect frame = self.frame;
@asendra
asendra / Widon't
Created April 20, 2014 05:24 — forked from PadraigK/Widon't
// Example:
//
// Widont makes the last space non-breaking
// so you don't end up with one word on its
// own.
//
// Widont makes the last space non-breaking
// so you don't end up with one word on
// its own.
//