This file contains hidden or 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
#!/bin/bash | |
# From: https://github.com/heroku/heroku-buildpack-metrics/blob/master/.profile.d/heroku-metrics-daemon.sh | |
setup_metrics() { | |
# don't do anything if we don't have a metrics url. | |
if [[ -z "$HEROKU_METRICS_URL" ]] || [[ "${DYNO}" = run\.* ]]; then | |
return 0 | |
fi | |
STARTTIME=$(date +%s) |
This file contains hidden or 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
date_start = Time.parse('11/08/2015').beginning_of_day | |
date_end = Time.parse('11/08/2015').end_of_day | |
created_at_day_tz = "date(created_at AT TIME ZONE \'UTC\' | |
AT TIME ZONE \'#{Time.zone.tzinfo.identifier}\')" | |
users = User.where("users.created_at BETWEEN ? AND ?", date_start, date_end) |
This file contains hidden or 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
User.find(885).created_at | |
"Sun, 31 Aug 2014 22:10:54 BRT -03:00" | |
User.select('created_at as created_at').where(id: 885) | |
[#<User id: nil, created_at: "2014-09-01 01:10:54">] | |
User.select('date(created_at) as created_at').where(id: 885) | |
[#<User id: nil, created_at: "2014-09-01">] | |
!!!!!!!!! NÃO! haha. Era pro date ser 2014-08-31. !!!!!!!!!!! |
This file contains hidden or 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
Organization.first.activities.map(&:users) | |
User.where(id: Organization.first.activity_users.pluck(:user_id)) | |
User.includes(activity_users: {activities: :organizations}).where(organization_id: Organization.first) | |
User.includes(activity_users: {activity: :organization}).where(activities: {organization_id: Organization.first}) |
This file contains hidden or 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
{ | |
"auto_complete": true, | |
"auto_complete_commit_on_tab": true, | |
"color_scheme": "Packages/User/SublimeLinter/Monokai (SL).tmTheme", | |
"copy_with_empty_selection": true, | |
"ensure_newline_at_eof_on_save": true, | |
"font_size": 12, | |
"ignored_packages": | |
[ | |
"Vintage" |
This file contains hidden or 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
config.before_configuration do | |
env_file = File.join(Rails.root, 'config', 'local_env.yml') | |
YAML.load(File.open(env_file)).each do |key, value| | |
ENV[key.to_s] = value | |
end if File.exists?(env_file) | |
end |
This file contains hidden or 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
# FORMATACAO FOLDER \W FORMATACAO | |
export PS1="\[\e[1m\]\W\[\e[0m\] \$ " | |
# adding RVM ruby information | |
# FORMATACAO RVM FORMATACAO | |
export PS1="[\[\e[31;1m\]\$(~/.rvm/bin/rvm-prompt i v p g)\[\e[0m\]]\[\e[0m\]:$PS1" | |
# adding Timestamp | |
# DIA DA SEMANA \D HORARIO \t | |
export PS1="[\[\e[31;1m\]\D{%d}\[\e[0m\]]\[\e[0m\][\[\e[31;1m\]\t\[\e[0m\]]\[\e[0m\]$PS1" |
This file contains hidden or 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
class OfflineTemplate < AbstractController::Base | |
include AbstractController::Logger | |
include AbstractController::Rendering | |
include AbstractController::Layouts | |
include AbstractController::Helpers | |
include AbstractController::Translation | |
include AbstractController::AssetPaths | |
include ActionDispatch::Routing::UrlFor | |
include Rails.application.routes.url_helpers | |
Rails.application.routes.default_url_options = { :host => 'www.yoursite.com' } |
This file contains hidden or 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
Para MAC OS! (O som só funciona em MacOs) | |
Faça download do script. | |
Edite ele de acordo com suas necessidades (jogos, categorias) | |
Abra o terminal. | |
Vá até a pasta do script. | |
execute com: | |
ruby kurira_ticket_notifier.rb |
NewerOlder