Skip to content

Instantly share code, notes, and snippets.

View firewalker06's full-sized avatar

Didik Wicaksono firewalker06

View GitHub Profile
@jmindek
jmindek / gist:62c50dd766556b7b16d6
Last active January 31, 2024 15:48
DISTINCT ON like functionality for Redshift

distinct column -> For each row returned, return only the unique members of a set. Think of it as for each row in a projection, concatenate all the column values and return only the strings that are unique.

test_db=# SELECT DISTINCT parent_id, child_id, id FROM test.foo_table ORDER BY parent_id, child_id, id LIMIT 10;
parent_id | child_id | id
-----------+------------+-----------------------------
1000040 | 103 | 1000040|2645405726|0001|103
# put this in your staging.rb file. Obviously you'll need more config than this it's just an example.
Rails.application.configure do
config.action_mailer.preview_path ||= defined?(Rails.root) ? "#{Rails.root}/test/mailers/previews" : nil
config.autoload_paths += [config.action_mailer.preview_path]
routes.append do
get '/rails/mailers' => "rails/mailers#index"
get '/rails/mailers/*path' => "rails/mailers#preview"
end
@rwaldron
rwaldron / barbie-bug-patch.md
Created November 21, 2014 02:09
Barbie Patches a Critical Bug

@shineyear
shineyear / Gemfile
Last active August 3, 2016 03:05
newrelic cloudwatch docker all in one monitor
source 'https://rubygems.org'
gem 'dashing'
## Remove this if you don't need a twitter widget.
gem 'twitter', '>= 5.9.0'
gem 'activeresource'
gem 'newrelic_api'
@lengarvey
lengarvey / staging.rb
Created June 29, 2014 11:28
Enabling Rails 4.1 mail previews in staging (or any other env besides development)
# put this in your staging.rb file. Obviously you'll need more config than this it's just an example.
Rails.application.configure do
config.action_mailer.preview_path ||= defined?(Rails.root) ? "#{Rails.root}/test/mailers/previews" : nil
config.autoload_paths += [config.action_mailer.preview_path]
routes.append do
get '/rails/mailers' => "rails/mailers#index"
get '/rails/mailers/*path' => "rails/mailers#preview"
end

Status

Resque.info
Resque.queues
Resque.redis
Resque.size(queue_name)

# check out what's coming next in the queue
#    Resque.peek(archive_queue)
@mlocher
mlocher / install_elasticsearch.sh
Last active August 29, 2015 14:01 — forked from flomotlik/elasticinstall.sh
Install any ElasticSearch version on Codeship
#!/bin/bash
echo "Please see an updated version of this script available at "
echo "https://github.com/codeship/scripts/blob/master/packages/elasticsearch.sh"
VERSION="1.1.1"
PORT="9333"
PWD=`pwd`
mkdir -p ~/elasticsearch/
@mjc
mjc / README.md
Last active February 10, 2017 17:53 — forked from erikwennerberg/README.md

Setup

Add the following gems to your Gemfile:

gem 'activeresource'
gem 'newrelic_api'

Update your bundle:

@mtowers
mtowers / README.md
Last active February 24, 2022 17:19
Google Analytics Website Visitor Count Widget for Dashing with OAuth2 Authentication
@mrchief
mrchief / LICENSE.md
Last active October 12, 2024 15:35
Add "Open with Sublime Text 2" to Windows Explorer Context Menu (including folders)

MIT License

Copyright (c) [year] [fullname]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: