Skip to content

Instantly share code, notes, and snippets.

@bttf
bttf / filter-images-by-size.sh
Last active December 13, 2017 22:05
Filter JPG images in directory recursively that are only greater than 2400 width
find . -name '*.jpg' -exec magick identify -format '%w %d/%f\n' {} \; | awk 'int($1) > 2400 {for (i=2; i<=NF; i++) printf $i " "; print ""}' > output.log
while read -r line; do cp "$line" ../paintings/; done < output.log
@bttf
bttf / controllers.application.js
Created May 11, 2017 03:04 — forked from samselikoff/mirage.config.js
Mirage dev boilerplate
import Ember from 'ember';
export default Ember.Controller.extend({
});
@bttf
bttf / controllers.application.js
Created May 11, 2017 03:04 — forked from samselikoff/mirage.config.js
Mirage dev boilerplate
import Ember from 'ember';
export default Ember.Controller.extend({
});
@bttf
bttf / controllers.application.js
Last active February 4, 2017 01:23
why-no-oneWay
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
firstArray: ['dogs', 'are', 'cool'],
secondArray: Ember.computed.reads('firstArray'),
firstObject: { message: 'coolness' },
secondObject: Ember.computed.reads('firstObject'),
@bttf
bttf / add_swap.sh
Created March 13, 2016 08:28
add swap - ubuntu 14.04
#!/bin/bash
sudo fallocate -l 4G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo swapon -s
@bttf
bttf / application.controller.js
Last active January 19, 2016 03:23
active links and such
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
groups: [{
id: 1,
}, {
id: 2,
}, {
id: 3
@bttf
bttf / file_join_patch.rb
Created March 29, 2013 19:44
file_join_patch.rb fixes an issue with ruby's file join implementation which blows up if non-UTF-8 encoding gets passed in
class File
class << self
alias_method :original_join, :join
end
def self.join(*args)
new_args = args.collect { |questionableEncoding|
join_encoding_fix(questionableEncoding)
}
self.send(:original_join, new_args)
---
message: 'this is common dude'
node default {
file {'/home/vagrant/testing-dev':
ensure => file,
content => hiera('message'),
}
}
:hierarchy:
- %{environment}
- common
:backends:
- yaml
:yaml:
:datadir: '/etc/puppet/hieradata'