You can use Rails Console to if queries are hanging.
connection = ActiveRecord::Base.connection
puts connection.execute("SHOW PROCESSLIST").map { |e| e.join(' | ') }
puts connection.execute("SHOW FULL PROCESSLIST").map { |e| e.join(' | ') }
require 'nokogiri' | |
require 'pry' | |
path_to_xml = "xml/3.xml" | |
xml = File.open(path_to_xml) { |f| Nokogiri::XML(f) } | |
seed = xml.xpath('//property').attr('value') | |
tests = xml.xpath('//testcase').each_with_object([]) do |testcase, tests| | |
tests << testcase.attr('file') | |
end |
<script id="InnStyle-js" src="http://developer.innstyle.co.uk/calendar.js"></script> | |
<script>InnStyle('thews', { offset: 78 });</script> |
set :theme_path, Pathname.new('web/app/themes/my_wp_theme') | |
set :local_app_path, Pathname.new('/Applications/MAMP/htdocs/my_wp_app') | |
set :local_theme_path, fetch(:local_app_path).join(fetch(:theme_path)) | |
namespace :deploy do | |
task :compile_assets do | |
run_locally do | |
within fetch(:local_theme_path) do | |
execute :grunt, :build | |
end |
<?php | |
/* | |
Example use: | |
$video = new Video('https://www.youtube.com/watch?v=xfJvrH7iQ3c', 1); | |
$video->render_embed(); | |
Use responsively: http://css-tricks.com/NetMag/FluidWidthVideo/Article-FluidWidthVideo.php | |
*/ |
<!DOCTYPE HTML> | |
<html lang="en-US"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Pavement Palace</title> | |
</head> | |
<body> | |
<script id="InnStyle-js" src="http://developer.innstyle.co.uk/calendar.js"></script> | |
<script>InnStyle('thepavementpalace', options = { |
convert photo.jpg -colorspace gray \( +clone -blur 0x10 \) +swap -compose divide -composite -linear-stretch 5%x0% sketch.jpg |
// Return 15 largest folders by file size | |
du -sm * | sort -nr | head -15 | |
//More useful way to debug syntax errors in http.conf | |
apachectl configtest | |
//Reload http.conf after making changes | |
service httpd reload | |
//NOTE: the above may require sudo if http.conf is struggling to open other configuration files |