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 'active_record' | |
ActiveRecord::Base.establish_connection( | |
:host => "localhost", | |
:user => "your_user", | |
:adapter => "mysql2", | |
:database => "your_database" | |
) | |
ActiveRecord::Base.connection.tables.each do |table_name| |
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
̥ ̥̥ ̥̥̥ ̥̥̥̥ ̥̥̥̥̥ ̥̥̥̥̥̥̥̊̊̊̊̊̊̊̊̊̊̊ ̥̥̥̥̥̥̥̥̊̊̊̊̊̊̊̊̊̊̊ ̥̥̥̥̥̥̥̥̥̊̊̊̊̊̊̊̊̊̊̊ ̥̥̥̥̥̥̥̥̊̊̊̊̊̊̊̊̊̊̊ ̥̥̥̥̥̥̥̊̊̊̊̊̊̊̊̊̊̊ ̥̥̥̥̥ ̥̥̥̥ ̥̥̥ ̥̥ ̥ | |
If we take a look at the actual characters of the above string | |
str.split(//).map(&:ord).to_s | |
=> [10, 805, 32, 805, 805, 32, 805, 805, 805, 32, 805, 805, 805, 805, 32, 805, 805, 805, 805, 805, 32, 805, 805, 805, 805, 805, 805, 805, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, 32, 805, 805, 805, 805, 805, 805, 805, 805, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, 32, 805, 805, 805, 805, 805, 805, 805, 805, 805, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, 32, 805, 805, 805, 805, 805, 805, 805, 805, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, 32, 805, 805, 805, 805, 805, 805, 805, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, 32, 805, 805, 805, 805, 805, 32, 805, 805, 805, 805, 32, 805, 805, 805, 32, 805, 805, 32, 805, 10] | |
Looking at the bulk ok this string, character 805, this appear |
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
## Gem Upgrade check | |
# | |
# Check your github repos for out of date gems | |
# | |
# usage: $ USERNAME=yourusername PASSWORD=yourpassword GEM=gemname VERSIONS=1.1,1.2,1.3 ruby railscheck.rb | |
# or | |
# usage: $ USERNAME=yourusername PASSWORD=yourpassword ORG=yourorgname GEM=gemname VERSIONS=1.1,1.2,1.3 ruby railscheck.rb | |
# | |
# n.b requires the octokit gem | |
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
# in config/initializers/riemann.rb | |
$riemann = Riemann::Client.new | |
channels_to_subscribe = ["auth","process_action.action_controller","deliver.action_mailer"] | |
channels_to_subscribe.each do |channel| | |
ActiveSupport::Notifications.subscribe channel do |*args| | |
event = ActiveSupport::Notifications::Event.new(*args) | |
Rails.logger.debug "ActiveSupport::Notifications #{event.name}, #{event.payload.inspect}" | |
riemann_event = { | |
host: `hostname`, | |
state: event.payload[:state], |
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 any ruby-version or rbenv-version files in your GitHub repos | |
# | |
# usage: $ USERNAME=yourusername PASSWORD=yourpassword ruby ruby_version_find.rb | |
# or | |
# usage: $ USERNAME=yourusername PASSWORD=yourpassword ORG=yourorgname ruby ruby_version_find.rb | |
# | |
# n.b requires the octokit gem | |
require 'rubygems' | |
require 'octokit' |
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
14:31 < piman_> I think this sounds awful. | |
14:31 < piman_> "Stress-testing this perspective" is the same as "devil's advocate trolling". | |
14:31 < piman_> And asking people to constantly explain themselves for your thought experiments is completely inconsiderate. | |
^ Potential misunderstanding about what you meant, which you later clarify but you followed with: | |
14:34 < txus> piman_: if learning is a thought experiment to you then you don't understand the value of discussion and bringing knowledge and new points of view to other people | |
^ This is dismissive, implying someone doesn't understand is a pretty low blow in a discussion |
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
//pin numbers | |
int LEFTRIGHT_DIR = 10; | |
int LEFTRIGHT_PWM = 9; | |
void setup() { | |
pinMode(LEFTRIGHT_DIR, OUTPUT); | |
pinMode(LEFTRIGHT_PWM, OUTPUT); | |
Serial.begin(9600); |
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
; -*- mode: clojure; -*- | |
; vim: filetype=clojure | |
(logging/init :file "/var/log/riemann/riemann.log") | |
; Listen on the local interface over TCP (5555), UDP (5555), and websockets | |
; (5556) | |
(let [host "127.0.0.1"] | |
(tcp-server :host host) | |
(udp-server :host host) |
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
foos = Foo.where(params) | |
if foos.any? | |
# Foo Load (0.1ms) select count from foos where params | |
if foos.size == 1 && foos.first.attribute == 'bar' | |
# Foo Load (0.1ms) select count from foos where params | |
# Foo Load (0.1ms) select * from foos where params | |
end | |
end |
OlderNewer