Skip to content

Instantly share code, notes, and snippets.

Adnan Chowdhury bttf

Block or report user

Report or block bttf

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@bttf
bttf / filter-images-by-size.sh
Last active Dec 13, 2017
Filter JPG images in directory recursively that are only greater than 2400 width
View filter-images-by-size.sh
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
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
});
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
});
View controllers.application.js
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 Mar 13, 2016
add swap - ubuntu 14.04
View add_swap.sh
#!/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 Jan 19, 2016
active links and such
View application.controller.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
groups: [{
id: 1,
}, {
id: 2,
}, {
id: 3
View index.html
<!DOCTYPE html>
<html>
<head>
<script src="http://cdn.firebase.com/js/client/2.0.2/firebase.js"></script>
<meta charset="utf-8">
<title>Ember Starter Kit</title>
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.1/normalize.css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="http://builds.handlebarsjs.com.s3.amazonaws.com/handlebars-v2.0.0.js"></script>
<script src="http://builds.emberjs.com/tags/v1.9.1/ember.js"></script>
@bttf
bttf / file_join_patch.rb
Created Mar 29, 2013
file_join_patch.rb fixes an issue with ruby's file join implementation which blows up if non-UTF-8 encoding gets passed in
View file_join_patch.rb
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)
View gist:5042179
---
message: 'this is common dude'
View gist:5042139
node default {
file {'/home/vagrant/testing-dev':
ensure => file,
content => hiera('message'),
}
}
You can’t perform that action at this time.