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
<duke> | |
<schema> | |
<threshold>0.8</threshold> | |
<path>temp</path> | |
<property type="id"> | |
<name>ID</name> | |
</property> | |
<property> |
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
Exception in thread "main" java.lang.RuntimeException: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure | |
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. | |
at no.priv.garshol.duke.utils.JDBCUtils.open(JDBCUtils.java:52) | |
at no.priv.garshol.duke.datasources.JDBCDataSource.getRecords(JDBCDataSource.java:67) | |
at no.priv.garshol.duke.Processor.index(Processor.java:355) | |
at no.priv.garshol.duke.Processor.link(Processor.java:268) | |
at no.priv.garshol.duke.Duke.main_(Duke.java:166) | |
at no.priv.garshol.duke.Duke.main(Duke.java:38) | |
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure |
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
<%= simple_form_for @product do |f| %> | |
<%= f.simple_fields_for :attributes do |d| %> | |
<% f.object.attributes.try(:each) do |key, value| %> | |
<%= d.input key, :input_html => {:value => value } %> | |
<% end %> | |
<% end %> | |
<% end %> |
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
class UsersField < ActiveRecord::Base | |
belongs_to :user | |
belongs_to :field | |
has_one :fields_group, through: :field | |
validates :value, allow_blank: true | |
def create_record | |
if !self.field.required & self.value.blank? |
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
class LastPayReport | |
def initialize employees | |
@employees = employees | |
end | |
def get_rows | |
@employees.map do |employee| | |
employee.compensations.last_two |
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
select f.*, count(*) cnt | |
from feedbacks f | |
LEFT JOIN feedbacks fn ON fn.id = (SELECT MAX(id) FROM feedbacks WHERE customer_id = f.customer_id) | |
WHERE (f.comment IS NOT NULL OR f.testimonial IS NOT NULL) AND f.company_id = 42 | |
GROUP BY f.recommend; |
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
drop table if exists secured_data; | |
--For secured payments: | |
SELECT DISTINCT c.id | |
into temp secured_data | |
FROM customers c | |
JOIN loans l ON c.id = l.customer_id | |
JOIN loan_tasks_committed lt on lt.loan_id = l.id | |
AND lt.loan_task_cd in ('payoff_loan_task','payoff_instl_task') | |
JOIN payment_transactions_committed pt on pt.loan_task_committed_id = lt.id |
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
$ git branch -r --merged origin/master | | |
grep origin | | |
grep -v '>' | | |
grep -v master | | |
xargs -L1 | | |
awk '{split($0,a,"/"); print a[2]}' | | |
xargs git push origin --delete |
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
#!/bin/bash | |
git branch -d -r `git branch -r | awk '{ if ($0 !~ /next|master/) printf "%s", $0 }'` | |
git branch -D `git branch | awk '{ if ($0 !~ /next|master/) printf "%s", $0 }'` |
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
# 0 is too far from ` ;) | |
set -g base-index 1 | |
# Automatically set window title | |
set-window-option -g automatic-rename on | |
set-option -g set-titles on | |
#set -g default-terminal screen-256color | |
set -g status-keys vi | |
set -g history-limit 10000 |