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
ffmpeg -itsoffset -7 -i video.mov -vcodec mjpeg -f rawvideo -s 624x416 image.jpg |
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
/*global define*/ | |
define([ | |
'routes/base', | |
'jquery', | |
'views/group_users' | |
], function (BaseRouter, $, GroupUsersView) { | |
'use strict'; | |
var GroupUserRouter = BaseRouter.extend({ |
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
#!/usr/bin/env ruby | |
def output_config | |
puts <<-END | |
graph_category App | |
graph_title passenger status | |
graph_vlabel count | |
sessions.label sessions | |
max.label max processes |
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
#!/usr/bin/env ruby | |
# put in /etc/munin/plugins and restart munin-node | |
# by Dan Manges, http://www.dcmanges.com/blog/rails-application-visualization-with-munin | |
# NOTE: you might need to add munin to allow passwordless sudo for passenger-memory-stats | |
def output_config | |
puts <<-END | |
graph_category App | |
graph_title Passenger memory stats | |
graph_vlabel count |
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
# to use this gist execute: $ rm -f 1506695 && wget https://raw.github.com/gist/1506695 && sh 1506695 | |
# refs to http://www.alfajango.com/blog/how-to-monitor-your-railspassenger-app-with-munin/ | |
echo "Installing munin..." | |
sudo apt-get install munin munin-node -y | |
echo ; | |
echo "Removing previous links for passenger_status and passenger_memory_stats..." | |
sudo rm /etc/munin/plugins/passenger_memory_stats | |
sudo rm /etc/munin/plugins/passenger_status |
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
# sem linhas em branco, código não tão junto | |
if current_user.has_role('admin') | |
cases = cases.of_product(product) | |
elif current_user.has_role('employee') | |
cases = cases.of_product_accessible_by_employee(product, current_user) | |
elif current_user.has_role('customer') | |
cases = cases.of_product_accessible_by_customer(product, current_user) |
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
// jquery | |
var $checkboxes = $("input[type='checkbox']"); | |
$checkboxes.change(function(){ | |
$checkboxes.not(this).removeAttr('checked'); | |
}); |
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
find -type f -iname "*~" -exec rm -f {} \; |
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
<?php | |
// util function to be used by sortArrayByKey function | |
function _arraySorterByKey($key, $array, $otherArray) { | |
$a = $array[$key]; | |
$b = $otherArray[$key]; | |
if ($a == $b) | |
return 0; |
OlderNewer