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
| find ... -iname "*.php" -exec php -l {} \; | grep -i "Errors.parsing" |
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
| a = MODEL.where("COLUMN like ?", "%SEARCH%");0 | |
| puts a.length | |
| puts " " | |
| a.all.each do |a| | |
| puts a.id | |
| end;0 |
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 = Date.new(2016,12,15) | |
| l = Table.where("created_at > ? AND column != 'variable'", date) | |
| ActiveRecord::Base.logger = nil | |
| results = [] | |
| l.each do |i| | |
| u = User.where(:email => i.email) | |
| if u.present? | |
| if Table.where(:email => u[0].email).blank? | |
| results << {:email=>i.email,:member=>'y'} |
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
| http { | |
| split_clients "${remote_addr}" $mirror { | |
| 33% "http://google.com"; | |
| 33% "http://yahoo.com"; | |
| * "http://bing.com"; | |
| } | |
| server { | |
| listen 0.0.0.0:80; |
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
| require 'csv' | |
| file = "#{Rails.root}/public/data.csv" | |
| table = User.all;0 # ";0" stops output. Change "User" to any model. | |
| CSV.open( file, 'w' ) do |writer| | |
| writer << table.first.attributes.map { |a,v| a } | |
| table.each do |s| | |
| writer << s.attributes.map { |a,v| v } |