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
ruby """ | |
def photo_gps_list | |
photos_dir = File.absolute_path('assets/photos/') | |
photos_url = '/assets/photos/' | |
photos = Dir.entries(photos_dir).select { |filename| filename if filename.end_with?('jpg') } | |
result = photos.map do |photo| | |
photo_exif = EXIFR::JPEG.new(photos_dir + '/' + photo) | |
puts "#{photo}, #{photo_exif.exif.date_time_original}, #{photo_exif.gps.longitude}, #{photo_exif.gps.latitude}" unless photo_exif.gps.nil? | |
end | |
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
pulseaudio -k | |
export DISPLAY=:0 | |
xset dpms on | |
xset dpms force on | |
i3-msg workspace 5 |
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
def func(string1, string2, block) | |
string = string1 + " " + string2 | |
puts "\#1: #{string}" | |
block.call(string, 'here') | |
end | |
# => :func | |
proc = Proc.new { |a, b| puts "\#2: #{a}, #{b}" } | |
func "calling", "function", proc | |
# #1: calling function |
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
adb devices -l # make sure your gadget is listed | |
adb shell # run a shell there | |
su # become the root (don't miss confirmation request!) | |
mount -o remount,rw /system # allow to write | |
vi /system/etc/hosts ## edit the file in place - do what you whant, then <ESC>:wq ## | |
mount -o remount,ro /system # get things back to normal | |
exit # unroot | |
nslookup YourBlockedAdSite.Net # check if it works | |
exit # good bye |
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
# the dialog had one text_box and one text_area before editing. | |
# in the dialog editor the text_area was removed. | |
# now after hitting 'save' button, i'm getting to the api: | |
From: /home/rblanco/devel/manageiq-api/app/controllers/api/service_dialogs_controller.rb @ line 33 Api::ServiceDialogsController#edit_resource: | |
31: def edit_resource(type, id, data) # type: :service_dialogs, id: 10000000000056, data: {"label"=>"testing", "content"=>{"dialog_tabs"=>[{"id"=>"10000000000841", "created_at"=>"2017-12-07T11:50:57Z", "updated_at"=>"2017-12-07T11:50:5 | |
32: binding.pry | |
=> 33: service_dialog = resource_search(id, type, Dialog) | |
34: begin |
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
=> #<DialogFieldDropDownList:0x00563c68b6d3c0 | |
id: 10000000005919, | |
name: "dropdown_list_1", | |
description: "", | |
type: "DialogFieldDropDownList", | |
data_type: "string", | |
notes: nil, | |
notes_display: nil, | |
display: "edit", | |
display_method: nil, |
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
--- | |
- description: | |
buttons: submit,cancel | |
label: uspto_provision_vm_jboss_eap | |
blueprint_id: | |
dialog_tabs: | |
- description: VM Details | |
display: edit | |
label: VM Details | |
display_method: |
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
Log for creating Tag Control containing dialog | |
D, [2018-01-12T15:47:28.286904 #15784] DEBUG -- : PostgreSQLAdapter#log_after_checkin, connection_pool: size: 5, connections: 5, in use: 1, waiting_in_queue: 0 | |
I, [2018-01-12T15:48:12.497772 #15784] INFO -- : Started POST "/api/service_dialogs/10000000000066" for ::1 at 2018-01-12 15:48:12 +0100 | |
I, [2018-01-12T15:48:12.551593 #15784] INFO -- : Processing by Api::ServiceDialogsController#update as JSON | |
I, [2018-01-12T15:48:12.551727 #15784] INFO -- : Parameters: {"c_id"=>"10000000000066"} | |
D, [2018-01-12T15:48:12.552314 #15784] DEBUG -- : Cache read: eeacccda3fd1faab0d74ce164382d4b6 | |
D, [2018-01-12T15:48:12.552779 #15784] DEBUG -- : Cache read: eeacccda3fd1faab0d74ce164382d4b6 |
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
describe Mixins::CheckedIdMixin do | |
describe '#find_records_with_rbac' do | |
# include tested mixin | |
let(:mixin) { Object.new.tap { |s| s.singleton_class.send(:include, described_class) } } | |
# TODO create user with rights to access vm_1 and vm_2 | |
let(:user_role) { FactoryGirl.create(:miq_user_role) } | |
let(:group) { FactoryGirl.create( | |
:miq_group, | |
:miq_user_role => user_role) | |
} |
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
# http://chartkick.com/ | |
require 'lastfm-client' | |
#require 'ap' | |
#require 'pry' | |
#require 'json' | |
LastFM.api_key = '' | |
LastFM.client_name = 'stats' |