git clone https://gist.github.com/ishu3101/6fb35afd237e42ef25f9
mv 6fb35afd237e42ef25f9 ConvertTo-Markdown
cd ConvertTo-Markdown
# ** ERROR 1 ** | |
# FATAL: lock file "postmaster.pid" already exists | |
# HINT: Is another postmaster (PID 4646) running in data directory "/usr/local/var/postgres"? | |
# | |
# ** ERROR 2 ** | |
# Is the server running locally and accepting connections on Unix domain socket "/tmp/.s.PGSQL.5432"? | |
# | |
# To fix one of this errors: | |
cat /usr/local/var/postgres/postmaster.pid # pid is the number on first line |
require 'rubygems' | |
require 'irb/completion' | |
require 'irb/ext/save-history' | |
ARGV.concat [ "--readline", | |
"--prompt-mode", | |
"simple" ] | |
# 25 entries in the list | |
IRB.conf[:SAVE_HISTORY] = 50 |
// | |
// UIImage+Retina4.h | |
// StunOMatic | |
// | |
// Created by Benjamin Stahlhood on 9/12/12. | |
// Copyright (c) 2012 DS Media Labs. All rights reserved. | |
// | |
#import <UIKit/UIKit.h> |
- (void)viewDidLoad | |
{ | |
[super viewDidLoad]; | |
UIView *view = [[UIView alloc] initWithFrame:CGRectMake(100, 100, 300, 200)]; | |
view.backgroundColor = [UIColor blueColor]; | |
[self.view addSubview:view]; | |
[view addObserver:self forKeyPath:@"frame" options:0 context:NULL]; |
module.exports = function(duration) { | |
return function(){ | |
return new Promise(function(resolve, reject){ | |
setTimeout(function(){ | |
resolve(); | |
}, duration) | |
}); | |
}; | |
}; |
# Backup | |
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
# Restore | |
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// see: https://github.com/chadoe/docker-cleanup-volumes
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
#!/usr/bin/env ruby | |
# Usage: dedup-imovie-library LIBRARY ORIGINALS | |
# | |
# Goes through an iMovie 10 library and replaces all the "Original Media" with | |
# symlinks to the actual original media, in order to conserve disk space. Note | |
# that because they're symlinks, if the path to the originals changes (e.g. you | |
# rename the external drive they are on) then the links will be broken. | |
# | |
# This assumes you've already imported the files into iMovie and waited for them |