Skip to content

Instantly share code, notes, and snippets.

{
"editor.fontFamily": "SFMono-Light, Menlo, Monaco, 'Courier New', monospace",
"editor.minimap.enabled": false,
"editor.renderControlCharacters": true,
"editor.rulers": [79, 119],
"workbench.statusBar.visible": true,
"workbench.activityBar.visible": false,
"workbench.startupEditor": "newUntitledFile",
"workbench.colorTheme": "Nord",
version: '2'
services:
web:
image: nginx:alpine
ports:
- "8080:80"
volumes:
- ./htdocs:/var/www/htdocs
- ./nginx/nginx.conf:/etc/nginx/conf.d/site.conf
links:
@dabio
dabio / ubuntu-minimal.md
Created October 27, 2015 15:17
Install ubuntu-minimal
# http://askubuntu.com/a/243059
apt-get install aptitude ubuntu-minimal
aptitude markauto '~i!~nubuntu-minimal'
aptitude install ssh
# https://linuxprograms.wordpress.com/2010/05/12/remove-packages-marked-rc/
dpkg -l | grep "^rc"  | cut -d " " -f 3 | xargs dpkg --purge
@dabio
dabio / gist:6f3a13391506b67338bc
Last active September 22, 2016 12:41
Install OS X on a shiny new mac
  1. install xcode
$ sudo xcodebuild -license
$ sudo gem install --no-rdoc --no-ri homesick
$ homesick clone dabio/dotfiles
$ homesick symlink dotfiles
$ vim +PluginInstall +qall
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
$ sudo chown -R dan:staff /usr/local

Keybase proof

I hereby claim:

  • I am dabio on github.
  • I am dabio (https://keybase.io/dabio) on keybase.
  • I have a public key whose fingerprint is F140 D335 981E 7AE2 8357 49A8 5B1E E898 A4C2 D9D3

To claim this, I am signing this object:

- (void)removeOldDatabase
{
if (![[[NSUserDefaults standardUserDefaults] objectForKey:@"parku-3.0.0"] boolValue]) {
NSURL *storeURL = [NSPersistentStore MR_defaultLocalStoreUrl];
NSError *error;
[[NSFileManager defaultManager] removeItemAtPath:storeURL.path error:&error];
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"parku-3.0.0"];
}
}
@dabio
dabio / gist:9929590
Last active August 29, 2015 13:58
Create small Images, Thumbnails and Rename
mogrify -filter spline -adaptive-resize 1600x -unsharp 0x1 *.JPG
mogrify -filter spline -resize 616x -unsharp 0x1 -path thumbs *.JPG
for files in *.JPG
do
mv "$files" "${files%.JPG}.jpg"
done
@dabio
dabio / gist:4239163
Created December 8, 2012 07:50 — forked from nickjenkin/gist:3175420
Golang Solr result xml parser
package solr
import (
"encoding/xml"
)
type SolrResponse struct {
Results SolrResults `xml:"result"`
}
@dabio
dabio / gist:3359898
Created August 15, 2012 12:52
Truncate all tables of a database
mysql -Nse 'SHOW TABLES' [database] | while read table; do mysql -e "TRUNCATE TABLE $table;" [database]; done
@dabio
dabio / gist:3359894
Created August 15, 2012 12:51
Drop all tables of a database
mysql -Nse 'SHOW TABLES' [database] | while read table; do mysql -e "DROP TABLE $table;" [database]; done