Copy the following into a shell script in fedena's root folder, give it executable permissions and run as :
./update_plugin_assets.sh vendor/plugins/my_awesome_plugin
#!/bin/sh
plugin_dir=$1
while inotifywait -r -e modify $plugin_dir ; do
............ | |
Retrieval is half of what Redis does best. | |
Before you put any data into Redis, you have to figure out how you want to get it back out. How you retrieve data is directly related to which of the five Redis data types you’ll use to store it. | |
To review, the five Redis data types are: strings, lists, hashes, sets, and sorted sets. | |
Start by asking yourself what kind of results you want from your data. | |
What do you need to retrieve? |
["http://dev.ehq.local/admin/reports/status?key=reports%3Astore%3Ainformation_report%3A9%3A319%3Alast_30_days%3A2014-02-05+00%3A00%3A00+%2B1100%3A2014-03-07+00%3A00%3A00+%2B1100%3Atrue%3A%7C%7C%7C%7C%7C%3A5"] | |
____________________________________________________________________________________________________ | |
["set_reports_session_prefixWriting {} to 419413b710fd1ae8e17483c37c835ad2:Admin::ReportsController "] | |
____________________________________________________________________________________________________ | |
["At 3"] | |
____________________________________________________________________________________________________ | |
["find_assigned_projectsWriting [\"319\"] to 419413b710fd1ae8e17483c37c835ad2:Admin::ReportsController:assigned_project_ids "] | |
____________________________________________________________________________________________________ | |
["At 3"] | |
____________________________________________________________________________________________________ |
#!/usr/bin/env ruby | |
file = "/home/srih4ri/code/rm_current_clem/to_delete.txt" | |
require "dbus" | |
sesbus = DBus.session_bus | |
clem_service = sesbus["org.mpris.clementine"] | |
clem_object = clem_service.object "/Player" | |
clem_object.introspect | |
clem_iface = clem_object['org.freedesktop.MediaPlayer'] | |
meta = clem_iface.GetMetadata | |
file_loc = meta[0]['location'].split('file://').last |
desc 'Run Devise tests for all ORMs.' | |
task :tests do | |
Dir[File.join(File.dirname(__FILE__), 'test', 'orm', '*.rb')].each do |file| | |
orm = File.basename(file).split(".").first | |
system "rake test DEVISE_ORM=#{orm}" | |
end | |
end | |
task :default => :tests |
Copy the following into a shell script in fedena's root folder, give it executable permissions and run as :
./update_plugin_assets.sh vendor/plugins/my_awesome_plugin
#!/bin/sh
plugin_dir=$1
while inotifywait -r -e modify $plugin_dir ; do
task :test do | |
require 'rake/runtest' | |
$: << 'lib' << '.' | |
Rake.run_tests 'test/unit/*_test.rb' | |
end | |
namespace :test do | |
desc "Test ROXML under the Nokogiri parser" | |
task :nokogiri do |
#!/usr/bin/ruby | |
require 'rubygems' | |
require 'active_record' | |
ActiveRecord::Base.establish_connection( | |
:adapter => "mysql", | |
:host => "localhost", | |
:username => "myuser", | |
:password => "mypass", | |
:database => "somedatabase" |
curl -s http://checkip.dyndns.com/|cut -d ":" -f 2|cut -d "<" -f 1 | |
#You might want to alias this thing to something shorter. `checkip` in my case. |
#!/usr/bin/env ruby | |
module PasswordChecker | |
def check_valid? | |
if length > 1 | |
(length/2).times { |i| | |
return false if (self[(i+1..length)].start_with? self[(0..i)]) | |
} | |
(self[(1..length)]).check_valid? | |
else | |
return true |
def get_stylesheets | |
styles_path = "#{Rails.root}/public/stylesheets" | |
controller_name = controller.controller_path | |
action_name = controller.action_name | |
if File.exists? "#{styles_path}/#{controller_name}/#{action_name}.css" | |
"#{controller_name}/#{action_name}" | |
elsif ["create","edit","update"].include? action_name and File.exists? " #{styles_path}/#{controller_name}/new.css" | |
"#{controller_name}/new" | |
end | |
end |