openssl enc -aes-256-ctr -pass pass:"$(dd if=/dev/urandom bs=128 count=1 2>/dev/null | base64)" -nosalt < /dev/zero | pv -pterb > /dev/sdb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for FILE in `ls *.JPG`; do \ | |
mogrify -resize 1920x -write resized/$FILE $FILE; \ | |
done | |
for FILE in `ls *.JPG`; do \ | |
mogrify -resize 1920x1080^ -gravity center -crop 1920x1080+0+0 +repage -write resized/$FILE $FILE; \ | |
done | |
for i in $(ls *.JPG); do exiv2 -r '%Y%m%d.%H%M%S' rename $i; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module SortItemsExtension | |
def sort_items(ids) | |
unless ids.is_a?(Array) | |
raise ArgumentError, "ids isn't an array" | |
end | |
ids.map!(&:to_i) | |
old_ids = proxy_association.ids_reader | |
ids = ids - (ids - old_ids) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(0..24).to_a.map do Thread.new do 0.upto(20000) do |i| ActiveRecord::Base.connection.execute("SELECT * FROM properties WHERE #{i}=#{i} LIMIT 1").to_a end end end.map(&:join) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
animation-duration: 0.001s; | |
} | |
@media screen and (min-width: 769px) { | |
body { | |
animation-name: media-table; | |
} | |
} | |
@media screen and (max-width: 768px) { | |
body { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :test do | |
run 'echo #{bundle_cmd}' | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var value = 1; | |
var c = days.length; | |
for (var i = 0; i < c; i++) { | |
var v = _source.minimum_stays[days[i]]; | |
if (v && value < v) { | |
value = v; | |
} | |
} | |
if (value == 1) { | |
value = _source.minimum_nights |
curl -XGET 'http://localhost:42001/bookings/booking/_search?&pretty=true' -d '{
"aggs": {
"test": {
"filter": {
"terms": {
"status": ["accepted"]
}
},
"aggs": {
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var logger=org.elasticsearch.common.logging.ESLoggerFactory.getLogger('myscript'); | |
logger.info(this); |